summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Nusinow <dnusinow@debian.org>2006-09-24 21:11:46 +0000
committerDavid Nusinow <dnusinow@debian.org>2006-09-24 21:11:46 +0000
commiteadb76b3f8e0e9b82da762bd29e53895bf9e6351 (patch)
treeb9f68fc763f9ea055287c366e61de84191b200ce /include
parentb3f7313ae4f4cd418522595e90e7d06ef6992f0a (diff)
Bump to latest mesa in Debian
Diffstat (limited to 'include')
-rw-r--r--include/GL/Makefile.am43
-rw-r--r--include/GL/foomesa.h76
-rw-r--r--include/GL/glut.h748
-rw-r--r--include/GL/glut_h.dja340
-rw-r--r--include/GL/glutf90.h81
-rw-r--r--include/GL/glx.h45
-rw-r--r--include/GL/internal/glcore.h18
-rw-r--r--include/GL/miniglx.h482
-rw-r--r--include/GLES/egl.h324
-rw-r--r--include/GLES/egltypes.h45
10 files changed, 2198 insertions, 4 deletions
diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am
new file mode 100644
index 00000000000..199bd5c8f3c
--- /dev/null
+++ b/include/GL/Makefile.am
@@ -0,0 +1,43 @@
+## Process this file with automake to produce Makefile.in
+
+GLincludedir = $(includedir)/GL
+
+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
+sel_inc_ggi = $(INC_GGI)
+endif
+
+if HAVE_OSMESA
+sel_inc_osmesa = $(INC_OSMESA)
+endif
+
+if HAVE_SVGA
+sel_inc_svga = $(INC_SVGA)
+endif
+
+if HAVE_X11
+sel_inc_x11 = $(INC_X11)
+endif
+
+if NEED_GLUT
+sel_inc_glut = $(INC_GLUT)
+endif
+
+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)
+include $(top_srcdir)/common_rules.make
diff --git a/include/GL/foomesa.h b/include/GL/foomesa.h
new file mode 100644
index 00000000000..8517d88388f
--- /dev/null
+++ b/include/GL/foomesa.h
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+
+/*
+ * 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/glut.h b/include/GL/glut.h
new file mode 100644
index 00000000000..23c740ee117
--- /dev/null
+++ b/include/GL/glut.h
@@ -0,0 +1,748 @@
+#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 <GL/gl.h>
+#include <GL/glu.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32)
+
+/* GLUT 3.7 now tries to avoid including <windows.h>
+ to avoid name space pollution, but Win32's <GL/gl.h>
+ 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 <process.h> */
+# if !defined(_MSC_VER) && !defined(__MINGW32__) && !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(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
+# 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;
+# 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 int,LPPIXELFORMATDESCRIPTOR);
+WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
+WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
+# undef WGLAPI
+# pragma warning( pop )
+#endif
+
+#else /* _WIN32 not defined */
+
+/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
+# define GLUTAPIENTRY GLAPIENTRY
+# define GLUTAPIENTRYV
+# define GLUTCALLBACK
+# define GLUTAPI extern
+
+#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!).
+
+ GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
+**/
+#ifndef GLUT_API_VERSION /* allow this to be overriden */
+#define GLUT_API_VERSION 5
+#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 <GL/glut.h>
+**/
+#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) || 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)
+
+/* 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 ndx, 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
+#if (GLUT_API_VERSION >= 5)
+typedef void (*GLUTproc)();
+GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
+#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
+
+#endif /* __glut_h__ */
diff --git a/include/GL/glut_h.dja b/include/GL/glut_h.dja
new file mode 100644
index 00000000000..e76dcb985e3
--- /dev/null
+++ b/include/GL/glut_h.dja
@@ -0,0 +1,340 @@
+
+/*
+ * 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.
+ */
+
+
+/*
+ * 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 <GL/gl.h>
+#include <GL/glu.h>
+
+#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..7ba3e19ef9e
--- /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 <GL/glut.h>
+
+/* 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/include/GL/glx.h b/include/GL/glx.h
index 1f5d778e34b..c70a29497cf 100644
--- a/include/GL/glx.h
+++ b/include/GL/glx.h
@@ -423,10 +423,47 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
#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);
+#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);
#endif /* GLX_EXT_texture_from_pixmap */
diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h
index 48748d91e8f..ff1beb71831 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_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
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+
/************************************************************************/
/*
diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h
new file mode 100644
index 00000000000..8c6180be60b
--- /dev/null
+++ b/include/GL/miniglx.h
@@ -0,0 +1,482 @@
+/*
+ * 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.
+ */
+
+
+/**
+ * \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 <GL/gl.h>
+#include <stdlib.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * \name Replacement Xlib/GLX types
+ */
+/*@{*/
+/**
+ * \brief Boolean type.
+ *
+ * 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.
+ */
+typedef struct MiniGLXSetWindowAttributesRec {
+ int background_pixel; /**< \brief background pixel */
+ int border_pixel; /**< \brief border pixel value */
+ MINI_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.
+ */
+#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 */
+ MINI_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;
+
+/**
+ * \brief GLX Frame Buffer Configuration (for pbuffers)
+ * \sa \ref datatypes.
+ */
+typedef struct MiniGLXFBConfigRec {
+ XVisualInfo *visInfo;
+} GLXFBConfig;
+
+
+/**
+ * \brief Display handle.
+ *
+ * Alias for the private ::MiniGLXDisplayRec structure.
+ *
+ * \sa \ref datatypes.
+ */
+#ifndef MINIGLX_NO_XTYPES
+typedef struct MiniGLXDisplayRec Display;
+#endif
+typedef struct MiniGLXDisplayRec MINI_Display;
+
+/**
+ * \brief Window handle.
+ *
+ * Alias for the private ::MiniGLXWindowRec structure.
+ *
+ * \sa \ref datatypes.
+ */
+#ifndef MINIGLX_NO_XTYPES
+typedef struct MiniGLXWindowRec *Window;
+#endif
+typedef struct MiniGLXWindowRec *MINI_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.
+ */
+#ifndef MINIGLX_NO_XTYPES
+typedef struct MiniGLXWindowRec *Drawable;
+#endif
+typedef struct MiniGLXWindowRec *MINI_Drawable;
+
+/**
+ * \brief GLX drawable.
+ *
+ * Alias for the private ::MiniGLXWindowRec structure.
+ *
+ * Same as #Drawable.
+ *
+ * \sa \ref datatypes.
+ */
+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.
+ *
+ * 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 */
+ 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 */
+} XExposeEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ 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 */
+ MINI_Bool override_redirect; /* creation should be overridden */
+} XCreateWindowEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ 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 */
+ 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 */
+ 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 */
+ 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 {
+ 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 VisualIDMask 0x1
+#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
+/** \brief Defined if version 1.1 of Mini GLX is supported. */
+#define MINI_GLX_VERSION_1_1 1
+/*@}*/
+
+
+/**
+ * \name Server-specific functions
+ */
+extern MINI_Display *
+__miniglx_StartServer( const char *display_name );
+
+extern int
+__miniglx_Select( MINI_Display *dpy, int maxfd,
+ fd_set *rfds, fd_set *wfds, fd_set *xfds,
+ struct timeval *tv );
+
+
+/**
+ * \name Simulated Xlib functions
+ */
+/*@{*/
+extern MINI_Display *
+XOpenDisplay( const char *dpy_name );
+
+
+extern void
+XCloseDisplay( MINI_Display *display );
+
+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(MINI_Display *display, XEvent *event_return);
+
+extern MINI_Bool
+XCheckMaskEvent( MINI_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( MINI_Display *display, MINI_Window w );
+
+extern void
+XMapWindow( MINI_Display *display, MINI_Window w );
+
+/* Should clients have access to this?
+ */
+extern void
+XUnmapWindow( MINI_Display *display, MINI_Window w );
+
+extern MINI_Colormap
+XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc );
+
+extern void
+XFreeColormap( MINI_Display *display, MINI_Colormap cmap );
+
+extern void
+XFree( void *data );
+
+extern XVisualInfo *
+XGetVisualInfo( MINI_Display *display, long vinfo_mask,
+ XVisualInfo *vinfo_template, int *nitems_return );
+/*@}*/
+
+
+
+/**
+ * \name GLX functions
+ */
+/*@{*/
+extern XVisualInfo*
+glXChooseVisual( MINI_Display *dpy, int screen, int *attribList );
+
+extern int
+glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value );
+
+extern GLXContext
+glXCreateContext( MINI_Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, MINI_Bool direct );
+
+extern void
+glXDestroyContext( MINI_Display *dpy, GLXContext ctx );
+
+extern MINI_Bool
+glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx);
+
+extern void
+glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable );
+
+extern GLXContext
+glXGetCurrentContext( void );
+
+extern GLXDrawable
+glXGetCurrentDrawable( void );
+
+extern void
+(*glXGetProcAddress(const GLubyte *procname))( void );
+
+extern MINI_Bool
+glXQueryVersion( MINI_Display *dpy, int *major, int *minor );
+
+/* Added in MiniGLX 1.1 */
+extern GLXPbuffer
+glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList );
+
+extern void
+glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf );
+
+extern GLXFBConfig *
+glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList,
+ int *nitems );
+
+extern XVisualInfo *
+glXGetVisualFromFBConfig( MINI_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 );
+
+/*@}*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MINIGLX_H */
diff --git a/include/GLES/egl.h b/include/GLES/egl.h
new file mode 100644
index 00000000000..f18c86ca62d
--- /dev/null
+++ b/include/GLES/egl.h
@@ -0,0 +1,324 @@
+#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.
+*/
+
+#if 0/*XXX TEMPORARY HACK*/
+#include <GLES/gl.h>
+#else
+#include <GL/gl.h>
+#endif
+#include <GLES/egltypes.h>
+
+/* 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
+#define EGL_VERSION_1_1 1
+
+/*
+** 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))(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);
+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);
+
+
+
+/* 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_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 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);
+GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
+GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
+
+#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 */
+
+
+/* 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
+
+#endif /* _EGL_H */
diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h
new file mode 100644
index 00000000000..65cba8d5793
--- /dev/null
+++ b/include/GLES/egltypes.h
@@ -0,0 +1,45 @@
+/*
+** egltypes.h for Mesa
+**
+** ONLY egl.h SHOULD INCLUDE THIS FILE!
+**
+** See comments about egltypes.h in the standard egl.h file.
+*/
+
+
+#include <sys/types.h>
+
+
+/*
+** 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;
+typedef u_int32_t EGLScreenMESA;
+
+
+/*
+** 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 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)