peter 25 yıl önce
ebeveyn
işleme
7f2d4e3b8b

+ 90 - 238
packages/opengl/build/glut.def

@@ -1,30 +1,7 @@
 # This is the definition file for all GLUT stuff
 
 %COPY_INTERFACE
-
-{ 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!). }
-
 const
-  GLUT_API_VERSION		= 4;
-
   // Display mode bit masks
   GLUT_RGB                      = 0;
   GLUT_RGBA                     = GLUT_RGB;
@@ -48,29 +25,7 @@ const
   GLUT_DOWN                     = 0;
   GLUT_UP                       = 1;
 
-  // function keys
-  GLUT_KEY_F1			= 1;
-  GLUT_KEY_F2			= 2;
-  GLUT_KEY_F3			= 3;
-  GLUT_KEY_F4			= 4;
-  GLUT_KEY_F5			= 5;
-  GLUT_KEY_F6			= 6;
-  GLUT_KEY_F7			= 7;
-  GLUT_KEY_F8			= 8;
-  GLUT_KEY_F9			= 9;
-  GLUT_KEY_F10			= 10;
-  GLUT_KEY_F11			= 11;
-  GLUT_KEY_F12			= 12;
-  // directional keys
-  GLUT_KEY_LEFT			= 100;
-  GLUT_KEY_UP			= 101;
-  GLUT_KEY_RIGHT		= 102;
-  GLUT_KEY_DOWN			= 103;
-  GLUT_KEY_PAGE_UP		= 104;
-  GLUT_KEY_PAGE_DOWN		= 105;
-  GLUT_KEY_HOME			= 106;
-  GLUT_KEY_END			= 107;
-  GLUT_KEY_INSERT		= 108;
+  // Keys ###
 
   // Enter / exit state
   GLUT_LEFT                     = 0;
@@ -99,6 +54,9 @@ const
   GLUT_NORMAL                   = 0;
   GLUT_OVERLAY                  = 1;
 
+  // Bitmap stuff###
+
+
   // glutGet parameters
   GLUT_WINDOW_X                 = 100;
   GLUT_WINDOW_Y                 = 101;
@@ -181,85 +139,21 @@ const
   GLUT_ACTIVE_CTRL              = 2;
   GLUT_ACTIVE_ALT               = 4;
 
-  // glutSetCursor parameters
-  // Basic arrows
-  GLUT_CURSOR_RIGHT_ARROW	= 0;
-  GLUT_CURSOR_LEFT_ARROW	= 1;
-  // Symbolic cursor shapes
-  GLUT_CURSOR_INFO		= 2;
-  GLUT_CURSOR_DESTROY		= 3;
-  GLUT_CURSOR_HELP		= 4;
-  GLUT_CURSOR_CYCLE		= 5;
-  GLUT_CURSOR_SPRAY		= 6;
-  GLUT_CURSOR_WAIT		= 7;
-  GLUT_CURSOR_TEXT		= 8;
-  GLUT_CURSOR_CROSSHAIR		= 9;
-  // Directional cursors
-  GLUT_CURSOR_UP_DOWN		= 10;
-  GLUT_CURSOR_LEFT_RIGHT	= 11;
-  // Sizing cursors
-  GLUT_CURSOR_TOP_SIDE		= 12;
-  GLUT_CURSOR_BOTTOM_SIDE	= 13;
-  GLUT_CURSOR_LEFT_SIDE		= 14;
-  GLUT_CURSOR_RIGHT_SIDE	= 15;
-  GLUT_CURSOR_TOP_LEFT_CORNER	= 16;
-  GLUT_CURSOR_TOP_RIGHT_CORNER	= 17;
-  GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18;
-  GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19;
-  // Inherit from parent window
-  GLUT_CURSOR_INHERIT		= 100;
-  // Blank cursor
-  GLUT_CURSOR_NONE		= 101;
-  // Fullscreen crosshair (if available)
-  GLUT_CURSOR_FULL_CROSSHAIR	= 102;
+  // Cursor stuff ###
 
+// GLUT window callback sub-API
 type
-
-  // GLUT menu sub-API
-  TGlutCreateMenuFunc = procedure(arg: Int); cdecl;
-
-  // GLUT window callback sub-API
-  TGlutDisplayFunc = procedure; cdecl;
-  TGlutReshapeFunc = procedure(width, height: Int); cdecl;
-  TGlutKeyboardFunc = procedure(key: Char; x, y: Int); cdecl;
-  TGlutMouseFunc = procedure(button, state, x, y: Int); cdecl;
-  TGlutMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutPassiveMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutEntryFunc = procedure(x, y: Int); cdecl;
-  TGlutVisibilityFunc = procedure(state: Int); cdecl;
-  TGlutIdleFunc = procedure; cdecl;
-  TGlutTimerFunc = procedure(value: Int); cdecl;
-  TGlutMenuStateFunc = procedure(state: Int); cdecl;
-  TGlutSpecialFunc = procedure(key, x, y: Int); cdecl;
-  TGlutSpaceballMotionFunc = procedure(x, y, z: Int); cdecl;
-  TGlutSpaceballRotateFunc = procedure(x, y, z: Int); cdecl;
-  TGlutSpaceballButtonFunc = procedure(button, state: Int); cdecl;
-  TGlutButtonBoxFunc = procedure(button, state: Int); cdecl;
-  TGlutDialsFunc = procedure(dial, value: Int); cdecl;
-  TGlutTabletMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutTabletButtonFunc = procedure(button, state, x, y: Int); cdecl;
-  TGlutMenuStatusFunc = procedure(status, x, y: Int); cdecl;
-  TGlutOverlayDisplayFunc = procedure; cdecl;
-  TGlutWindowStatusFunc = procedure(state: Int); cdecl;
-  TGlutKeyboardUpFunc = procedure(key: Char; x, y: Int); cdecl;
-  TGlutSpecialUpFunc = procedure(key, x, y: Int); cdecl;
-  TGlutJoystickFunc = procedure(buttonMask: UnsignedInt; x, y, z: Int); cdecl;
-
-const
-// GLUT device control sub-API
-  // glutSetKeyRepeat modes.
-  GLUT_KEY_REPEAT_OFF		= 0;
-  GLUT_KEY_REPEAT_ON		= 1;
-  GLUT_KEY_REPEAT_DEFAULT	= 2;
-
-  // Joystick button masks
-  GLUT_JOYSTICK_BUTTON_A	= 1;
-  GLUT_JOYSTICK_BUTTON_B	= 2;
-  GLUT_JOYSTICK_BUTTON_C	= 4;
-  GLUT_JOYSTICK_BUTTON_D	= 8;
+  TGlutDisplayFunc = procedure; extdecl
+  TGlutReshapeFunc = procedure(width, height: Integer); extdecl
+  TGlutTimerFunc = procedure(value: Integer); extdecl
+  TGlutKeyboardFunc = procedure(key: char;x,y:Integer); extdecl
+  TGlutIdleFunc = procedure; extdecl
+  TGlutVisibilityFunc = procedure(state:Integer); extdecl
 
 // GLUT game mode sub-API
-  // glutGameModeGet
+{$ifdef GLUT_GAME}
+// glutGameModeGet
+const
   GLUT_GAME_MODE_ACTIVE         = 0;
   GLUT_GAME_MODE_POSSIBLE       = 1;
   GLUT_GAME_MODE_WIDTH          = 2;
@@ -267,9 +161,7 @@ const
   GLUT_GAME_MODE_PIXEL_DEPTH    = 4;
   GLUT_GAME_MODE_REFRESH_RATE   = 5;
   GLUT_GAME_MODE_DISPLAY_CHANGED= 6;
-
-
-var
+{$endif GLUT_GAME}
 %END
 
 
@@ -279,142 +171,102 @@ var
 
 %PROCS
 // GLUT initialization sub-API
-  glutInit: procedure(argcp: PInt; argv: PPChar);
-  glutInitDisplayMode: procedure(mode: UnsignedInt);
-  glutInitDisplayString: procedure(const AString: PChar);
-  glutInitWindowPosition: procedure(x, y: Int);
-  glutInitWindowSize: procedure(width, height: Int);
+  glutInit: procedure(argcp: PInteger; argv: PPChar);
+  glutInitDisplayMode: procedure(mode: LongWord);
+  glutInitDisplayString: procedure(AString: PChar);
+  glutInitWindowPosition: procedure(x, y: Integer);
+  glutInitWindowSize: procedure(width, height: Integer);
   glutMainLoop: procedure;
 
 // GLUT window sub-API
-  glutCreateWindow: function(const title: PChar): Int;
-  glutCreateSubWindow: function(win, x, y, width, height: Int): Int;
-  glutDestroyWindow: procedure(win: Int);
+  glutCreateWindow: function(title: PChar): Integer;
+  glutCreateSubWindow: function(win, x, y, width, height: Integer): Integer;
+  glutDestroyWindow: procedure(win: Integer);
   glutPostRedisplay: procedure;
-  glutPostWindowRedisplay: procedure(win: Int);
+  glutPostWindowRedisplay: procedure(win: Integer);
   glutSwapBuffers: procedure;
-  glutGetWindow: function: Int;
-  glutSetWindow: procedure(win: Int);
-  glutSetWindowTitle: procedure(const title: PChar);
+  glutGetWindow: function: Integer;
+  glutSetWindow: procedure(win: Integer);
+  glutSetWindowTitle: procedure(title: PChar);
   glutSetIconTitle: procedure(title: PChar);
-  glutPositionWindow: procedure(x, y: Int);
-  glutReshapeWindow: procedure(width, height: Int);
+  glutPositionWindow: procedure(x, y: Integer);
+  glutReshapeWindow: procedure(width, height: Integer);
   glutPopWindow: procedure;
   glutPushWindow: procedure;
   glutIconifyWindow: procedure;
   glutShowWindow: procedure;
   glutHideWindow: procedure;
   glutFullScreen: procedure;
-  glutSetCursor: procedure(cursor: Int);
-  glutWarpPointer: procedure(x, y: Int);
-
-// GLUT overlay sub-API
-  glutEstablishOverlay: procedure;
-  glutRemoveOverlay: procedure;
-  glutUseLayer: procedure(layer: GLenum);
-  glutPostOverlayRedisplay: procedure;
-  glutPostWindowOverlayRedisplay: procedure(win: Int);
-  glutShowOverlay: procedure;
-  glutHideOverlay: procedure;
-
-// GLUT menu sub-API
-  glutCreateMenu: function(func: TGlutCreateMenuFunc): Int;
-  glutDestroyMenu: procedure(menu: Int);
-  glutGetMenu: function: Int;
-  glutSetMenu: procedure(menu: Int);
-  glutAddMenuEntry: procedure(const ALabel: PChar; value: Int);
-  glutAddSubMenu: procedure(const ALabel: PChar; submenu: Int);
-  glutChangeToMenuEntry: procedure(item: Int; const ALabel: PChar; value: Int);
-  glutChangeToSubMenu: procedure(item: Int; const ALabel: PChar; submenu: Int);
-  glutRemoveMenuItem: procedure(item: Int);
-  glutAttachMenu: procedure(button: Int);
-  glutDetachMenu: procedure(button: Int);
+  glutSetCursor: procedure(cursor: Integer);
+  glutWarpPointer: procedure(x, y: Integer);
+
+//overlays ###
+
+//menus ###
 
 // GLUT window callback sub-API
   glutDisplayFunc: procedure(func: TGlutDisplayFunc);
   glutReshapeFunc: procedure(func: TGlutReshapeFunc);
-  glutKeyboardFunc: procedure(func: TGlutKeyboardFunc);
-  glutMouseFunc: procedure(func: TGlutMouseFunc);
-  glutMotionFunc: procedure(func: TGlutMotionFunc);
-  glutPassiveMotionFunc: procedure(func: TGlutPassiveMotionFunc);
-  glutEntryFunc: procedure(func: TGlutEntryFunc);
-  glutIdleFunc: procedure(func: TGlutIdleFunc);
-  glutTimerFunc: procedure(millis: UnsignedInt; func: TGlutTimerFunc; value: Int);
-  glutMenuStateFunc: procedure(func: TGlutMenuStateFunc);
-  glutSpecialFunc: procedure(func: TGlutSpecialFunc);
-  glutSpaceballMotionFunc: procedure(func: TGlutSpaceballMotionFunc);
-  glutSpaceballRotateFunc: procedure(func: TGlutSpaceballRotateFunc);
-  glutSpaceballButtonFunc: procedure(func: TGlutSpaceballButtonFunc);
-  glutButtonBoxFunc: procedure(func: TGlutButtonBoxFunc);
-  glutDialsFunc: procedure(func: TGlutDialsFunc);
-  glutTabletMotionFunc: procedure(func: TGlutTabletMotionFunc);
-  glutTabletButtonFunc: procedure(func: TGlutTabletButtonFunc);
-  glutMenuStatusFunc: procedure(func: TGlutMenuStatusFunc);
-  glutOverlayDisplayFunc: procedure(func: TGlutOverlayDisplayFunc);
-  glutWindowStatusFunc: procedure(func: TGlutWindowStatusFunc);
-  glutKeyboardUpFunc: procedure(func: TGlutKeyboardUpFunc);
-  glutSpecialUpFunc: procedure(func: TGlutSpecialUpFunc);
-  glutJoystickFunc: procedure(func: TGlutJoystickFunc; pollinterval: Int);
+
+  glutTimerFunc: procedure(millis: LongWord; func: TGlutTimerFunc; value: longint);
+  glutKeyboardFunc : procedure(func: TGlutKeyboardFunc);
+  glutIdleFunc : procedure(func: TGlutIdleFunc);
+  glutVisibilityFunc : procedure(func: TGlutVisibilityFunc);
+
+// 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));
+// GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
+// GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
+// GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK * func)(unsigned int buttonMask, int x, int y, int z), int pollInterval)
 
 // GLUT color index sub-API
-  glutSetColor: procedure(index: Int; red, green, blue: GLfloat);
-  glutGetColor: function(ndx, component: Int): GLfloat;
-  glutCopyColormap: procedure(win: Int);
+  glutSetColor: procedure(index: Integer; red, green, blue: Single);
+  glutGetColor: function(ndx, component: Integer): Single;
+  glutCopyColormap: procedure(win: Integer);
 
 // GLUT state retrieval sub-API
-  glutGet: function(AType: GLEnum): Int;
-  glutDeviceGet: function(AType: GLEnum): Int;
-  glutExtensionSupported: function(const name: PChar): Int;
-  glutGetModifiers: function: Int;
-  glutLayerGet: function(AType: GLEnum): Int;
-
-// GLUT font sub-API
-  glutBitmapCharacter: procedure(font: Pointer; character: Int);
-  glutBitmapWidth: function(font: Pointer; character: Int): Int;
-  glutStrokeCharacter: procedure(font: Pointer; character: Int);
-  glutStrokeWidth: function(font: Pointer; character: Int): Int;
-  glutBitmapLength: function(font: Pointer; const AString: PChar): Int;
-  glutStrokeLength: function(font: Pointer; const AString: PChar): Int;
-
-// GLUT pre-built models sub-API
-  glutWireSphere: procedure(radius: GLdouble; slices, stacks: GLint);
-  glutSolidSphere: procedure(radius: GLdouble; slices, stacks: GLint);
-  glutWireCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint);
-  glutSolidCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint);
-  glutWireCube: procedure(size: GLdouble);
-  glutSolidCube: procedure(size: GLdouble);
-  glutWireTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint);
-  glutSolidTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint);
-  glutWireDodecahedron: procedure;
-  glutSolidDodecahedron: procedure;
-  glutWireTeapot: procedure(size: GLdouble);
-  glutSolidTeapot: procedure(size: GLdouble);
-  glutWireOctahedron: procedure;
-  glutSolidOctahedron: procedure;
-  glutWireTetrahedron: procedure;
-  glutSolidTetrahedron: procedure;
-  glutWireIcosahedron: procedure;
-  glutSolidIcosahedron: procedure;
-
-// GLUT video resize sub-API
-  glutVideoResizeGet: function(param: GLenum): Int;
-  glutSetupVideoResizing: procedure;
-  glutStopVideoResizing: procedure;
-  glutVideoResize: procedure(x, y, width, height: Int);
-  glutVideoPan: procedure(x, y, width, height: Int);
-
-// GLUT debugging sub-API
-  glutReportErrors: procedure;
-
-// GLUT device control sub-API
-  glutIgnoreKeyRepeat: procedure(ignore: Int);
-  glutSetKeyRepeat: procedure(repeatMode: Int);
-  glutForceJoystickFunc: procedure;
+  glutGet: function(AType: GLEnum): Integer;
+  glutDeviceGet: function(AType: GLEnum): Integer;
+  glutExtensionSupported: function(name: PChar): Integer;
+  glutGetModifiers: function: Integer;
+  glutLayerGet: function(AType: GLEnum): Integer;
+
+// fonts ###
+
+// pre-built models ###
+
+// video resize ###
+
+// debugging ###
+
+// device control ###
+
 
 // GLUT game mode sub-API
-  glutGameModeString: procedure(const AString: PChar);
+{$ifdef GLUT_GAME}
+  glutGameModeString: procedure(AString: PChar);
   glutEnterGameMode: function: Integer;
   glutLeaveGameMode: procedure;
-  glutGameModeGet: function(mode: GLEnum): Int;
-
+  glutGameModeGet: function(mode: GLEnum): Integer;
+{$endif GLUT_GAME}
 %END

+ 1 - 1
packages/opengl/examples/Makefile

@@ -176,7 +176,7 @@ endif
 
 # Targets
 
-override EXEOBJECTS+=glutdemo morph3d
+override EXEOBJECTS+=glutdemo morph3d bounce
 
 # Clean
 

+ 4 - 2
packages/opengl/examples/Makefile.fpc

@@ -3,13 +3,15 @@
 #
 
 [targets]
-programs=glutdemo
+programs=glutdemo morph3d bounce
 
 [require]
-packages=opengl x11
+packages=opengl
+packages_linux=x11
 
 [dirs]
 fpcdir=../../..
 
 [libs]
 libother=1
+libgcc=1

Dosya farkı çok büyük olduğundan ihmal edildi
+ 715 - 973
packages/opengl/linux/gl.pp


+ 379 - 0
packages/opengl/linux/glu.pp

@@ -0,0 +1,379 @@
+{
+  $Id$
+
+  Translation of the Mesa GLU headers for FreePascal
+  Copyright (C) 1999 Sebastian Guenther
+
+
+  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.
+}
+
+{$MODE delphi}  // objfpc would not work because of direct proc var assignments
+
+{You have to enable Macros (compiler switch "-Sm") for compiling this unit!
+ This is necessary for supporting different platforms with different calling
+ conventions via a single unit.}
+
+unit GLU;
+
+interface
+
+{$MACRO ON}
+
+{$IFDEF Linux}
+  uses GL;
+{$ELSE}
+  {$MESSAGE Unsupported platform.}
+{$ENDIF}
+
+
+// =======================================================
+//   Unit specific extensions
+// =======================================================
+
+function InitGLUFromLibrary(libname: PChar): Boolean;
+
+
+// determines automatically which libraries to use:
+function InitGLU: Boolean;
+
+
+var
+  GLUDumpUnresolvedFunctions,
+  GLUInitialized: Boolean;
+
+
+// =======================================================
+//   GLU consts, types and functions
+// =======================================================
+
+const
+  GLU_TRUE                              = GL_TRUE;
+  GLU_FALSE                             = GL_FALSE;
+
+  // 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;   // cannot 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;
+
+type
+  PGLUquadricObj = ^TGLUquadricObj;
+  TGLUquadricObj = record end;
+  PGLUtriangulatorObj = ^TGLUtriangulatorObj;
+  TGLUtriangulatorObj = record end;
+  PGLUnurbsObj = ^TGLUnurbsObj;
+  TGLUnurbsObj = record end;
+
+  TGLUQuadricCallback = procedure; cdecl;
+  TGLUNurbsCallback = procedure; cdecl;
+  TGLUTessCallback = procedure; cdecl;
+
+  TGLUViewport = array[0..3] of LongInt;
+  TGLUMatrixd = array[0..15] of Double;
+  TGLUMatrixf = array[0..15] of Single;
+  TGLUVectord = array[0..2] of Double;
+
+
+var
+  // Miscellaneous functions
+  gluLookAt: procedure(eye, eyey, eyez, centerx, centery, centerz, upx, upy, upz: Double); cdecl;
+  gluOrtho2D: procedure(left, right, bottom, top: Double); cdecl;
+  gluPerspective: procedure(fovy, aspect, zNear, zFar: Double); cdecl;
+  gluPickMatrix: procedure(x, y, width, height: Double; const viewport: TGLUViewport); cdecl;
+  gluProject: procedure(objx, objy, objz: Double; const modelMatrix, projMatrix: TGLUMatrixd; const viewport: TGLUViewport; winx, winy, winz: Double); cdecl;
+  gluUnProject: procedure(winx, winy, winz: Double; const modelMatrix, projMatrix: TGLUMatrixd; const viewport: TGLUViewport; objx, objy, objz: Double); cdecl;
+  gluErrorString: procedure(errorCode: GLenum); cdecl;
+
+  // Mipmapping and image scaling
+  gluScaleImage: procedure(format: GLenum; within, heightin: LongInt; typein: GLenum; var datain; widthout, heightout: LongInt; typeout: GLenum; var dataout); cdecl;
+  gluBuild1DMipmaps: procedure(target: GLenum; components, width: LongInt; format, AType: GLEnum; var data); cdecl;
+  gluBuild2DMipmaps: procedure(target: GLenum; components, width, height: LongInt; format, AType: GLEnum; var data); cdecl;
+
+  // Quadrics
+  gluNewQuadric: function: PGLUquadricObj; cdecl;
+  gluDeleteQuadric: procedure(state: PGLUquadricObj); cdecl;
+  gluQuadricDrawStyle: procedure(quadObject: PGLUquadricObj; drawStyle: GLenum); cdecl;
+  gluQuadricOrientation: procedure(quadObject: PGLUquadricObj; orientation: GLenum); cdecl;
+  gluQuadricNormals: procedure(quadObject: PGLUquadricObj; normals: GLenum); cdecl;
+  gluQuadricTexture: procedure(quadObject: PGLUquadricObj; textureCoords: Boolean); cdecl;
+  gluQuadricCallback: procedure(quadObject: PGLUquadricObj; which: GLenum; fn: TGLUQuadricCallback); cdecl;
+  gluCylinder: procedure(qobj: PGLUquadricObj; baseRadius, topRadius, height: Double; slices, stacks: LongInt); cdecl;
+  gluSphere: procedure(qobj: PGLUquadricObj; radius: Double; slices, stacks: LongInt); cdecl;
+  gluDisk: procedure(qobj: PGLUquadricObj; innerRadius, outerRadius: Double; slices, loops: LongInt); cdecl;
+  gluPartialDisk: procedure(qobj: PGLUquadricObj; innerRadius, outerRadius: Double; slices, loops: LongInt; startAngle, sweepAngle: Double); cdecl;
+
+  // Nurbs
+  gluNewNurbsRenderer: function: PGLUnurbsObj; cdecl;
+  gluDeleteNurbsRenderer: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluLoadSamplingMatrices: procedure(nobj: PGLUnurbsObj; const modelMatrix, projMatrix: TGLUMatrixf; const viewport: TGLUViewport); cdecl;
+  gluNurbsProperty: procedure(nobj: PGLUnurbsObj; AProperty: GLenum; value: Single); cdecl;
+  gluGetNurbsProperty: procedure(nobj: PGLUnurbsObj; AProperty: GLEnum; var value: Single); cdecl;
+  gluBeginCurve: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluEndCurve: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluNurbsCurve: procedure(nobj: PGLUnurbsObj; nknots: LongInt; var know: Single; stride: LongInt; var ctlarray: Single; order: LongInt; AType: GLenum); cdecl;
+  gluBeginSurface: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluEndSurface: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluNurbsSurface: procedure(nobj: PGLUnurbsObj; sknot_count: LongInt; var sknot: Single; tknot_count: LongInt; var tknot: Single; s_stride, t_stride: LongInt; var ctlarray: Single; sorder, torder: LongInt; AType: GLenum); cdecl;
+  gluBeginTrim: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluEndTrim: procedure(nobj: PGLUnurbsObj); cdecl;
+  gluPwlCurve: procedure(nobj: PGLUnurbsObj; count: LongInt; var AArray: Single; stride: LongInt; AType: GLenum); cdecl;
+  gluNurbsCallback: procedure(nobj: PGLUnurbsObj; which: GLenum; fn: TGLUNurbsCallback); cdecl;
+
+  // Polygon tesselation
+  gluNewTess: function: PGLUtriangulatorObj; cdecl;
+  gluTessCallback: procedure(tobj: PGLUtriangulatorObj; which: GLenum; fn: TGLUTessCallback); cdecl;
+
+  gluDeleteTess: procedure(tobj: PGLUtriangulatorObj); cdecl;
+  gluBeginPolygon: procedure(tobj: PGLUtriangulatorObj); cdecl;
+  gluEndPolygon: procedure(tobj: PGLUtriangulatorObj); cdecl;
+  gluNextContour: procedure(tobj: PGLUtriangulatorObj; AType: GLenum); cdecl;
+  gluTessVertex: procedure(tobj: PGLUtriangulatorObj; v: TGLUVectord; var data); cdecl;
+
+  // New functions in GLU 1.1
+  gluGetString: function(name: GLenum): PChar; cdecl;
+
+
+// =======================================================
+//
+// =======================================================
+
+implementation
+
+{$LINKLIB m}
+
+function dlopen(AFile: PChar; mode: LongInt): Pointer; external 'dl';
+function dlclose(handle: Pointer): LongInt; external 'dl';
+function dlsym(handle: Pointer; name: PChar): Pointer; external 'dl';
+
+function LoadLibrary(name: PChar): Pointer;
+begin
+  Result := dlopen(name, $101 {RTLD_GLOBAL or RTLD_LAZY});
+end;
+
+function GetProc(handle: Pointer; name: PChar): Pointer;
+begin
+  Result := dlsym(handle, name);
+  if (Result = nil) and GLUDumpUnresolvedFunctions then
+    WriteLn('Unresolved: ', name);
+end;
+
+var
+  libGLU : Pointer;
+
+function InitGLUFromLibrary(libname: PChar): Boolean;
+begin
+  Result := False;
+  libGLU := LoadLibrary(libname);
+  if not Assigned(libGLU) then exit;
+
+  // Miscellaneous functions
+  gluLookAt := GetProc(libglu, 'gluLookAt');
+  gluOrtho2D := GetProc(libglu, 'gluOrtho2D');
+  gluPerspective := GetProc(libglu, 'gluPerspective');
+  gluPickMatrix := GetProc(libglu, 'gluPickMatrix');
+  gluProject := GetProc(libglu, 'gluProject');
+  gluUnProject := GetProc(libglu, 'gluUnProject');
+  gluErrorString := GetProc(libglu, 'gluErrorString');
+  // Mipmapping and image scaling
+  gluScaleImage := GetProc(libglu, 'gluScaleImage');
+  gluBuild1DMipmaps := GetProc(libglu, 'gluBuild1DMipmaps');
+  gluBuild2DMipmaps := GetProc(libglu, 'gluBuild2DMipmaps');
+  // Quadrics
+  gluNewQuadric := GetProc(libglu, 'gluNewQuadric');
+  gluDeleteQuadric := GetProc(libglu, 'gluDeleteQuadric');
+  gluQuadricDrawStyle := GetProc(libglu, 'gluQuadricDrawStyle');
+  gluQuadricOrientation := GetProc(libglu, 'gluQuadricOrientation');
+  gluQuadricNormals := GetProc(libglu, 'gluQuadricNormals');
+  gluQuadricTexture := GetProc(libglu, 'gluQuadricTexture');
+  gluQuadricCallback := GetProc(libglu, 'gluQuadricCallback');
+  gluCylinder := GetProc(libglu, 'gluCylinder');
+  gluSphere := GetProc(libglu, 'gluSphere');
+  gluDisk := GetProc(libglu, 'gluDisk');
+  gluPartialDisk := GetProc(libglu, 'gluPartialDisk');
+  // Nurbs
+  gluNewNurbsRenderer := GetProc(libglu, 'gluNewNurbsRenderer');
+  gluDeleteNurbsRenderer := GetProc(libglu, 'gluDeleteNurbsRenderer');
+  gluLoadSamplingMatrices := GetProc(libglu, 'gluLoadSamplingMatrices');
+  gluNurbsProperty := GetProc(libglu, 'gluNurbsProperty');
+  gluGetNurbsProperty := GetProc(libglu, 'gluGetNurbsProperty');
+  gluBeginCurve := GetProc(libglu, 'gluBeginCurve');
+  gluEndCurve := GetProc(libglu, 'gluEndCurve');
+  gluNurbsCurve := GetProc(libglu, 'gluNurbsCurve');
+  gluBeginSurface := GetProc(libglu, 'gluBeginSurface');
+  gluEndSurface := GetProc(libglu, 'gluEndSurface');
+  gluNurbsSurface := GetProc(libglu, 'gluNurbsSurface');
+  gluBeginTrim := GetProc(libglu, 'gluBeginTrim');
+  gluEndTrim := GetProc(libglu, 'gluEndTrim');
+  gluPwlCurve := GetProc(libglu, 'gluPwlCurve');
+  gluNurbsCallback := GetProc(libglu, 'gluNurbsCallback');
+  // Polygon tesselation
+  gluNewTess := GetProc(libglu, 'gluNewTess');
+  gluTessCallback := GetProc(libglu, 'gluTessCallback');
+  gluDeleteTess := GetProc(libglu, 'gluDeleteTess');
+  gluBeginPolygon := GetProc(libglu, 'gluBeginPolygon');
+  gluEndPolygon := GetProc(libglu, 'gluEndPolygon');
+  gluNextContour := GetProc(libglu, 'gluNextContour');
+  gluTessVertex := GetProc(libglu, 'gluTessVertex');
+  // New functions in GLU 1.1
+  gluGetString := GetProc(libglu, 'gluGetString');
+
+  GLUInitialized := True;
+  Result := True;
+end;
+
+
+function InitGLU: Boolean;
+begin
+  Result := InitGLUFromLibrary('libGLU.so') or
+            InitGLUFromLibrary('libGLU.so.1') or
+            InitGLUFromLibrary('libMesaGLU.so') or
+            InitGLUFromLibrary('libMesaGLU.so.3');
+end;
+
+
+initialization
+  InitGlU;
+finalization
+  if Assigned(libGLU) then dlclose(libGLU);
+end.
+
+
+{
+  $Log$
+  Revision 1.1.2.1  2000-10-01 22:12:28  peter
+    * new demo
+
+  Revision 1.1  2000/07/13 06:34:18  michael
+  + Initial import
+
+  Revision 1.1  2000/05/31 00:35:14  alex
+  added working templates
+
+}
+
+
+{
+  $Log$
+  Revision 1.1.2.1  2000-10-01 22:12:28  peter
+    * new demo
+
+}

+ 178 - 368
packages/opengl/linux/glut.pp

@@ -1,63 +1,58 @@
 {
   $Id$
 
-  Translation of the GLUT 3.7 headers for Free Pascal, Linux version
-  Copyright (C) 1999-2000 Sebastian Guenther, [email protected]
+  Translation of the Mesa GLUT headers for FreePascal
+  Linux Version, Copyright (C) 1999 Sebastian Guenther
 
 
-  Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998.
+  Mesa 3-D graphics library
+  Version:  3.0
+  Copyright (C) 1995-1998  Brian Paul
 
-  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 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.
 
-unit GLUT;
+  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.
+}
 
 {$MODE delphi}
 
+unit GLUT;
+
 interface
 
-uses GL;
+{$MACRO ON}
+
+{$IFDEF Linux}
+  {$DEFINE gldecl := cdecl;}
+  {$DEFINE extdecl := cdecl;}
+  uses GL;
+{$ELSE}
+  {$MESSAGE Unsupported platform.}
+{$ENDIF}
+
 
-function InitGLUTFromLibrary(const libname: PChar): Boolean;
+function InitGLUTFromLibrary(libname: PChar): Boolean;
 
 // determines automatically which library to use:
 function InitGLUT: Boolean;
 
 
 var
+  GLUTDumpUnresolvedFunctions,
   GLUTInitialized: Boolean;
 
-  { Set the following value to True if you want to have a list of all
-    unresolved GLUT functions dumped to the console }
-  GLUTDumpUnresolvedFunctions: Boolean;
-
-
-{ 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!). }
 
 const
-  GLUT_API_VERSION		= 4;
-
   // Display mode bit masks
   GLUT_RGB                      = 0;
   GLUT_RGBA                     = GLUT_RGB;
@@ -81,29 +76,7 @@ const
   GLUT_DOWN                     = 0;
   GLUT_UP                       = 1;
 
-  // function keys
-  GLUT_KEY_F1			= 1;
-  GLUT_KEY_F2			= 2;
-  GLUT_KEY_F3			= 3;
-  GLUT_KEY_F4			= 4;
-  GLUT_KEY_F5			= 5;
-  GLUT_KEY_F6			= 6;
-  GLUT_KEY_F7			= 7;
-  GLUT_KEY_F8			= 8;
-  GLUT_KEY_F9			= 9;
-  GLUT_KEY_F10			= 10;
-  GLUT_KEY_F11			= 11;
-  GLUT_KEY_F12			= 12;
-  // directional keys
-  GLUT_KEY_LEFT			= 100;
-  GLUT_KEY_UP			= 101;
-  GLUT_KEY_RIGHT		= 102;
-  GLUT_KEY_DOWN			= 103;
-  GLUT_KEY_PAGE_UP		= 104;
-  GLUT_KEY_PAGE_DOWN		= 105;
-  GLUT_KEY_HOME			= 106;
-  GLUT_KEY_END			= 107;
-  GLUT_KEY_INSERT		= 108;
+  // Keys ###
 
   // Enter / exit state
   GLUT_LEFT                     = 0;
@@ -132,6 +105,9 @@ const
   GLUT_NORMAL                   = 0;
   GLUT_OVERLAY                  = 1;
 
+  // Bitmap stuff###
+
+
   // glutGet parameters
   GLUT_WINDOW_X                 = 100;
   GLUT_WINDOW_Y                 = 101;
@@ -214,85 +190,21 @@ const
   GLUT_ACTIVE_CTRL              = 2;
   GLUT_ACTIVE_ALT               = 4;
 
-  // glutSetCursor parameters
-  // Basic arrows
-  GLUT_CURSOR_RIGHT_ARROW	= 0;
-  GLUT_CURSOR_LEFT_ARROW	= 1;
-  // Symbolic cursor shapes
-  GLUT_CURSOR_INFO		= 2;
-  GLUT_CURSOR_DESTROY		= 3;
-  GLUT_CURSOR_HELP		= 4;
-  GLUT_CURSOR_CYCLE		= 5;
-  GLUT_CURSOR_SPRAY		= 6;
-  GLUT_CURSOR_WAIT		= 7;
-  GLUT_CURSOR_TEXT		= 8;
-  GLUT_CURSOR_CROSSHAIR		= 9;
-  // Directional cursors
-  GLUT_CURSOR_UP_DOWN		= 10;
-  GLUT_CURSOR_LEFT_RIGHT	= 11;
-  // Sizing cursors
-  GLUT_CURSOR_TOP_SIDE		= 12;
-  GLUT_CURSOR_BOTTOM_SIDE	= 13;
-  GLUT_CURSOR_LEFT_SIDE		= 14;
-  GLUT_CURSOR_RIGHT_SIDE	= 15;
-  GLUT_CURSOR_TOP_LEFT_CORNER	= 16;
-  GLUT_CURSOR_TOP_RIGHT_CORNER	= 17;
-  GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18;
-  GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19;
-  // Inherit from parent window
-  GLUT_CURSOR_INHERIT		= 100;
-  // Blank cursor
-  GLUT_CURSOR_NONE		= 101;
-  // Fullscreen crosshair (if available)
-  GLUT_CURSOR_FULL_CROSSHAIR	= 102;
+  // Cursor stuff ###
 
+// GLUT window callback sub-API
 type
-
-  // GLUT menu sub-API
-  TGlutCreateMenuFunc = procedure(arg: Int); cdecl;
-
-  // GLUT window callback sub-API
-  TGlutDisplayFunc = procedure; cdecl;
-  TGlutReshapeFunc = procedure(width, height: Int); cdecl;
-  TGlutKeyboardFunc = procedure(key: Char; x, y: Int); cdecl;
-  TGlutMouseFunc = procedure(button, state, x, y: Int); cdecl;
-  TGlutMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutPassiveMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutEntryFunc = procedure(x, y: Int); cdecl;
-  TGlutVisibilityFunc = procedure(state: Int); cdecl;
-  TGlutIdleFunc = procedure; cdecl;
-  TGlutTimerFunc = procedure(value: Int); cdecl;
-  TGlutMenuStateFunc = procedure(state: Int); cdecl;
-  TGlutSpecialFunc = procedure(key, x, y: Int); cdecl;
-  TGlutSpaceballMotionFunc = procedure(x, y, z: Int); cdecl;
-  TGlutSpaceballRotateFunc = procedure(x, y, z: Int); cdecl;
-  TGlutSpaceballButtonFunc = procedure(button, state: Int); cdecl;
-  TGlutButtonBoxFunc = procedure(button, state: Int); cdecl;
-  TGlutDialsFunc = procedure(dial, value: Int); cdecl;
-  TGlutTabletMotionFunc = procedure(x, y: Int); cdecl;
-  TGlutTabletButtonFunc = procedure(button, state, x, y: Int); cdecl;
-  TGlutMenuStatusFunc = procedure(status, x, y: Int); cdecl;
-  TGlutOverlayDisplayFunc = procedure; cdecl;
-  TGlutWindowStatusFunc = procedure(state: Int); cdecl;
-  TGlutKeyboardUpFunc = procedure(key: Char; x, y: Int); cdecl;
-  TGlutSpecialUpFunc = procedure(key, x, y: Int); cdecl;
-  TGlutJoystickFunc = procedure(buttonMask: UnsignedInt; x, y, z: Int); cdecl;
-
-const
-// GLUT device control sub-API
-  // glutSetKeyRepeat modes.
-  GLUT_KEY_REPEAT_OFF		= 0;
-  GLUT_KEY_REPEAT_ON		= 1;
-  GLUT_KEY_REPEAT_DEFAULT	= 2;
-
-  // Joystick button masks
-  GLUT_JOYSTICK_BUTTON_A	= 1;
-  GLUT_JOYSTICK_BUTTON_B	= 2;
-  GLUT_JOYSTICK_BUTTON_C	= 4;
-  GLUT_JOYSTICK_BUTTON_D	= 8;
+  TGlutDisplayFunc = procedure; extdecl
+  TGlutReshapeFunc = procedure(width, height: Integer); extdecl
+  TGlutTimerFunc = procedure(value: Integer); extdecl
+  TGlutKeyboardFunc = procedure(key: char;x,y:Integer); extdecl
+  TGlutIdleFunc = procedure; extdecl
+  TGlutVisibilityFunc = procedure(state:Integer); extdecl
 
 // GLUT game mode sub-API
-  // glutGameModeGet
+{$ifdef GLUT_GAME}
+// glutGameModeGet
+const
   GLUT_GAME_MODE_ACTIVE         = 0;
   GLUT_GAME_MODE_POSSIBLE       = 1;
   GLUT_GAME_MODE_WIDTH          = 2;
@@ -300,219 +212,147 @@ const
   GLUT_GAME_MODE_PIXEL_DEPTH    = 4;
   GLUT_GAME_MODE_REFRESH_RATE   = 5;
   GLUT_GAME_MODE_DISPLAY_CHANGED= 6;
+{$endif GLUT_GAME}
 
-
-var
-
-{ The following stuff does not exist in the Win32 version: }
-(* commented out because cvars don't work in Delphi mode...
-// Stroke font opaque addresses (use constants instead in source code).
-var
-  glutStrokeRoman, glutStrokeMonoRoman: Pointer; cvar; external;
-
-// Stroke font constants (use these in GLUT program).
-const
-  GLUT_STROKE_ROMAN = @glutStrokeRoman;
-  GLUT_STROKE_MONO_ROMAN = @glutStrokeMonoRoman;
-
-// Bitmap font opaque addresses (use constants instead in source code).
 var
-  glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
-    glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
-    glutBitmapHelvetica18: Pointer; cdecl; external;
-
-// Bitmap font constants (use these in GLUT program).
-const
-  GLUT_BITMAP_9_BY_15 = @glutBitmap9By15;
-  GLUT_BITMAP_8_BY_13 = @glutBitmap8By13;
-  GLUT_BITMAP_TIMES_ROMAN_10 = @glutBitmapTimesRoman10;
-  GLUT_BITMAP_TIMES_ROMAN_24 = @glutBitmapTimesRoman24;
-  GLUT_BITMAP_HELVETICA_10 = @glutBitmapHelvetica10;
-  GLUT_BITMAP_HELVETICA_12 = @glutBitmapHelvetica12;
-  GLUT_BITMAP_HELVETICA_18 = @glutBitmapHelvetica18;*)
-
 // GLUT initialization sub-API
-  glutInit: procedure(argcp: PInt; argv: PPChar); cdecl;
-  glutInitDisplayMode: procedure(mode: UnsignedInt); cdecl;
-  glutInitDisplayString: procedure(const AString: PChar); cdecl;
-  glutInitWindowPosition: procedure(x, y: Int); cdecl;
-  glutInitWindowSize: procedure(width, height: Int); cdecl;
+  glutInit: procedure(argcp: PInteger; argv: PPChar); cdecl;
+  glutInitDisplayMode: procedure(mode: LongWord); cdecl;
+  glutInitDisplayString: procedure(AString: PChar); cdecl;
+  glutInitWindowPosition: procedure(x, y: Integer); cdecl;
+  glutInitWindowSize: procedure(width, height: Integer); cdecl;
   glutMainLoop: procedure; cdecl;
 
 // GLUT window sub-API
-  glutCreateWindow: function(const title: PChar): Int; cdecl;
-  glutCreateSubWindow: function(win, x, y, width, height: Int): Int; cdecl;
-  glutDestroyWindow: procedure(win: Int); cdecl;
+  glutCreateWindow: function(title: PChar): Integer; cdecl;
+  glutCreateSubWindow: function(win, x, y, width, height: Integer): Integer; cdecl;
+  glutDestroyWindow: procedure(win: Integer); cdecl;
   glutPostRedisplay: procedure; cdecl;
-  glutPostWindowRedisplay: procedure(win: Int); cdecl;
+  glutPostWindowRedisplay: procedure(win: Integer); cdecl;
   glutSwapBuffers: procedure; cdecl;
-  glutGetWindow: function: Int; cdecl;
-  glutSetWindow: procedure(win: Int); cdecl;
-  glutSetWindowTitle: procedure(const title: PChar); cdecl;
+  glutGetWindow: function: Integer; cdecl;
+  glutSetWindow: procedure(win: Integer); cdecl;
+  glutSetWindowTitle: procedure(title: PChar); cdecl;
   glutSetIconTitle: procedure(title: PChar); cdecl;
-  glutPositionWindow: procedure(x, y: Int); cdecl;
-  glutReshapeWindow: procedure(width, height: Int); cdecl;
+  glutPositionWindow: procedure(x, y: Integer); cdecl;
+  glutReshapeWindow: procedure(width, height: Integer); cdecl;
   glutPopWindow: procedure; cdecl;
   glutPushWindow: procedure; cdecl;
   glutIconifyWindow: procedure; cdecl;
   glutShowWindow: procedure; cdecl;
   glutHideWindow: procedure; cdecl;
   glutFullScreen: procedure; cdecl;
-  glutSetCursor: procedure(cursor: Int); cdecl;
-  glutWarpPointer: procedure(x, y: Int); cdecl;
-
-// GLUT overlay sub-API
-  glutEstablishOverlay: procedure; cdecl;
-  glutRemoveOverlay: procedure; cdecl;
-  glutUseLayer: procedure(layer: GLenum); cdecl;
-  glutPostOverlayRedisplay: procedure; cdecl;
-  glutPostWindowOverlayRedisplay: procedure(win: Int); cdecl;
-  glutShowOverlay: procedure; cdecl;
-  glutHideOverlay: procedure; cdecl;
-
-// GLUT menu sub-API
-  glutCreateMenu: function(func: TGlutCreateMenuFunc): Int; cdecl;
-  glutDestroyMenu: procedure(menu: Int); cdecl;
-  glutGetMenu: function: Int; cdecl;
-  glutSetMenu: procedure(menu: Int); cdecl;
-  glutAddMenuEntry: procedure(const ALabel: PChar; value: Int); cdecl;
-  glutAddSubMenu: procedure(const ALabel: PChar; submenu: Int); cdecl;
-  glutChangeToMenuEntry: procedure(item: Int; const ALabel: PChar; value: Int); cdecl;
-  glutChangeToSubMenu: procedure(item: Int; const ALabel: PChar; submenu: Int); cdecl;
-  glutRemoveMenuItem: procedure(item: Int); cdecl;
-  glutAttachMenu: procedure(button: Int); cdecl;
-  glutDetachMenu: procedure(button: Int); cdecl;
+  glutSetCursor: procedure(cursor: Integer); cdecl;
+  glutWarpPointer: procedure(x, y: Integer); cdecl;
+
+//overlays ###
+
+//menus ###
 
 // GLUT window callback sub-API
   glutDisplayFunc: procedure(func: TGlutDisplayFunc); cdecl;
   glutReshapeFunc: procedure(func: TGlutReshapeFunc); cdecl;
-  glutKeyboardFunc: procedure(func: TGlutKeyboardFunc); cdecl;
-  glutMouseFunc: procedure(func: TGlutMouseFunc); cdecl;
-  glutMotionFunc: procedure(func: TGlutMotionFunc); cdecl;
-  glutPassiveMotionFunc: procedure(func: TGlutPassiveMotionFunc); cdecl;
-  glutEntryFunc: procedure(func: TGlutEntryFunc); cdecl;
-  glutIdleFunc: procedure(func: TGlutIdleFunc); cdecl;
-  glutTimerFunc: procedure(millis: UnsignedInt; func: TGlutTimerFunc; value: Int); cdecl;
-  glutMenuStateFunc: procedure(func: TGlutMenuStateFunc); cdecl;
-  glutSpecialFunc: procedure(func: TGlutSpecialFunc); cdecl;
-  glutSpaceballMotionFunc: procedure(func: TGlutSpaceballMotionFunc); cdecl;
-  glutSpaceballRotateFunc: procedure(func: TGlutSpaceballRotateFunc); cdecl;
-  glutSpaceballButtonFunc: procedure(func: TGlutSpaceballButtonFunc); cdecl;
-  glutButtonBoxFunc: procedure(func: TGlutButtonBoxFunc); cdecl;
-  glutDialsFunc: procedure(func: TGlutDialsFunc); cdecl;
-  glutTabletMotionFunc: procedure(func: TGlutTabletMotionFunc); cdecl;
-  glutTabletButtonFunc: procedure(func: TGlutTabletButtonFunc); cdecl;
-  glutMenuStatusFunc: procedure(func: TGlutMenuStatusFunc); cdecl;
-  glutOverlayDisplayFunc: procedure(func: TGlutOverlayDisplayFunc); cdecl;
-  glutWindowStatusFunc: procedure(func: TGlutWindowStatusFunc); cdecl;
-  glutKeyboardUpFunc: procedure(func: TGlutKeyboardUpFunc); cdecl;
-  glutSpecialUpFunc: procedure(func: TGlutSpecialUpFunc); cdecl;
-  glutJoystickFunc: procedure(func: TGlutJoystickFunc; pollinterval: Int); cdecl;
+
+  glutTimerFunc: procedure(millis: LongWord; func: TGlutTimerFunc; value: longint); cdecl;
+  glutKeyboardFunc : procedure(func: TGlutKeyboardFunc); cdecl;
+  glutIdleFunc : procedure(func: TGlutIdleFunc); cdecl;
+  glutVisibilityFunc : procedure(func: TGlutVisibilityFunc); cdecl;
+
+// 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));
+// GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
+// GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
+// GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK * func)(unsigned int buttonMask, int x, int y, int z), int pollInterval)
 
 // GLUT color index sub-API
-  glutSetColor: procedure(index: Int; red, green, blue: GLfloat); cdecl;
-  glutGetColor: function(ndx, component: Int): GLfloat; cdecl;
-  glutCopyColormap: procedure(win: Int); cdecl;
+  glutSetColor: procedure(index: Integer; red, green, blue: Single); cdecl;
+  glutGetColor: function(ndx, component: Integer): Single; cdecl;
+  glutCopyColormap: procedure(win: Integer); cdecl;
 
 // GLUT state retrieval sub-API
-  glutGet: function(AType: GLEnum): Int; cdecl;
-  glutDeviceGet: function(AType: GLEnum): Int; cdecl;
-  glutExtensionSupported: function(const name: PChar): Int; cdecl;
-  glutGetModifiers: function: Int; cdecl;
-  glutLayerGet: function(AType: GLEnum): Int; cdecl;
-
-// GLUT font sub-API
-  glutBitmapCharacter: procedure(font: Pointer; character: Int); cdecl;
-  glutBitmapWidth: function(font: Pointer; character: Int): Int; cdecl;
-  glutStrokeCharacter: procedure(font: Pointer; character: Int); cdecl;
-  glutStrokeWidth: function(font: Pointer; character: Int): Int; cdecl;
-  glutBitmapLength: function(font: Pointer; const AString: PChar): Int; cdecl;
-  glutStrokeLength: function(font: Pointer; const AString: PChar): Int; cdecl;
-
-// GLUT pre-built models sub-API
-  glutWireSphere: procedure(radius: GLdouble; slices, stacks: GLint); cdecl;
-  glutSolidSphere: procedure(radius: GLdouble; slices, stacks: GLint); cdecl;
-  glutWireCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint); cdecl;
-  glutSolidCone: procedure(base: GLdouble; height: GLdouble; slices, stacks: GLint); cdecl;
-  glutWireCube: procedure(size: GLdouble); cdecl;
-  glutSolidCube: procedure(size: GLdouble); cdecl;
-  glutWireTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); cdecl;
-  glutSolidTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); cdecl;
-  glutWireDodecahedron: procedure; cdecl;
-  glutSolidDodecahedron: procedure; cdecl;
-  glutWireTeapot: procedure(size: GLdouble); cdecl;
-  glutSolidTeapot: procedure(size: GLdouble); cdecl;
-  glutWireOctahedron: procedure; cdecl;
-  glutSolidOctahedron: procedure; cdecl;
-  glutWireTetrahedron: procedure; cdecl;
-  glutSolidTetrahedron: procedure; cdecl;
-  glutWireIcosahedron: procedure; cdecl;
-  glutSolidIcosahedron: procedure; cdecl;
-
-// GLUT video resize sub-API
-  glutVideoResizeGet: function(param: GLenum): Int; cdecl;
-  glutSetupVideoResizing: procedure; cdecl;
-  glutStopVideoResizing: procedure; cdecl;
-  glutVideoResize: procedure(x, y, width, height: Int); cdecl;
-  glutVideoPan: procedure(x, y, width, height: Int); cdecl;
-
-// GLUT debugging sub-API
-  glutReportErrors: procedure; cdecl;
-
-// GLUT device control sub-API
-  glutIgnoreKeyRepeat: procedure(ignore: Int); cdecl;
-  glutSetKeyRepeat: procedure(repeatMode: Int); cdecl;
-  glutForceJoystickFunc: procedure; cdecl;
+  glutGet: function(AType: GLEnum): Integer; cdecl;
+  glutDeviceGet: function(AType: GLEnum): Integer; cdecl;
+  glutExtensionSupported: function(name: PChar): Integer; cdecl;
+  glutGetModifiers: function: Integer; cdecl;
+  glutLayerGet: function(AType: GLEnum): Integer; cdecl;
+
+// fonts ###
+
+// pre-built models ###
+
+// video resize ###
+
+// debugging ###
+
+// device control ###
+
 
 // GLUT game mode sub-API
-  glutGameModeString: procedure(const AString: PChar); cdecl;
+{$ifdef GLUT_GAME}
+  glutGameModeString: procedure(AString: PChar); cdecl;
   glutEnterGameMode: function: Integer; cdecl;
   glutLeaveGameMode: procedure; cdecl;
-  glutGameModeGet: function(mode: GLEnum): Int; cdecl;
-
+  glutGameModeGet: function(mode: GLEnum): Integer; cdecl;
+{$endif GLUT_GAME}
 
 
 implementation
 
 {$LINKLIB Xmu}
 
-function dlopen(const AFile: PChar; mode: LongInt): Pointer; external 'dl';
+function dlopen(AFile: PChar; mode: LongInt): Pointer; external 'dl';
 function dlclose(handle: Pointer): LongInt; external 'dl';
-function dlsym(handle: Pointer; const name: PChar): Pointer; external 'dl';
+function dlsym(handle: Pointer; name: PChar): Pointer; external 'dl';
 
-function LoadLibrary(const name: PChar): Pointer;
+function LoadLibrary(name: PChar): Pointer;
 begin
   Result := dlopen(name, $101 {RTLD_GLOBAL or RTLD_LAZY});
 end;
 
-procedure FreeLibrary(handle: Pointer);
-begin
-  dlclose(handle);
-end;
-
-function GetProc(handle: Pointer; const name: PChar): Pointer;
+function GetProc(handle: Pointer; name: PChar): Pointer;
 begin
   Result := dlsym(handle, name);
-  if not Assigned(Result) and GLUTDumpUnresolvedFunctions then
+  if (Result = nil) and GLUTDumpUnresolvedFunctions then
     WriteLn('Unresolved: ', name);
 end;
 
 var
   libGLUT: Pointer;
 
-function InitGLUTFromLibrary(const libname: PChar): Boolean;
+function InitGLUTFromLibrary(libname: PChar): Boolean;
 begin
   Result := False;
   libGLUT := LoadLibrary(libname);
-  if not Assigned(libGLUT) then
-    exit;
+  if not Assigned(libGLUT) then exit;
 
+// GLUT initialization sub-API
   glutInit := GetProc(libglut, 'glutInit');
   glutInitDisplayMode := GetProc(libglut, 'glutInitDisplayMode');
   glutInitDisplayString := GetProc(libglut, 'glutInitDisplayString');
   glutInitWindowPosition := GetProc(libglut, 'glutInitWindowPosition');
   glutInitWindowSize := GetProc(libglut, 'glutInitWindowSize');
   glutMainLoop := GetProc(libglut, 'glutMainLoop');
+// GLUT window sub-API
   glutCreateWindow := GetProc(libglut, 'glutCreateWindow');
   glutCreateSubWindow := GetProc(libglut, 'glutCreateSubWindow');
   glutDestroyWindow := GetProc(libglut, 'glutDestroyWindow');
@@ -533,93 +373,62 @@ begin
   glutFullScreen := GetProc(libglut, 'glutFullScreen');
   glutSetCursor := GetProc(libglut, 'glutSetCursor');
   glutWarpPointer := GetProc(libglut, 'glutWarpPointer');
-  glutEstablishOverlay := GetProc(libglut, 'glutEstablishOverlay');
-  glutRemoveOverlay := GetProc(libglut, 'glutRemoveOverlay');
-  glutUseLayer := GetProc(libglut, 'glutUseLayer');
-  glutPostOverlayRedisplay := GetProc(libglut, 'glutPostOverlayRedisplay');
-  glutPostWindowOverlayRedisplay := GetProc(libglut, 'glutPostWindowOverlayRedisplay');
-  glutShowOverlay := GetProc(libglut, 'glutShowOverlay');
-  glutHideOverlay := GetProc(libglut, 'glutHideOverlay');
-  glutCreateMenu := GetProc(libglut, 'glutCreateMenu');
-  glutDestroyMenu := GetProc(libglut, 'glutDestroyMenu');
-  glutGetMenu := GetProc(libglut, 'glutGetMenu');
-  glutSetMenu := GetProc(libglut, 'glutSetMenu');
-  glutAddMenuEntry := GetProc(libglut, 'glutAddMenuEntry');
-  glutAddSubMenu := GetProc(libglut, 'glutAddSubMenu');
-  glutChangeToMenuEntry := GetProc(libglut, 'glutChangeToMenuEntry');
-  glutChangeToSubMenu := GetProc(libglut, 'glutChangeToSubMenu');
-  glutRemoveMenuItem := GetProc(libglut, 'glutRemoveMenuItem');
-  glutAttachMenu := GetProc(libglut, 'glutAttachMenu');
-  glutDetachMenu := GetProc(libglut, 'glutDetachMenu');
+//overlays ###
+//menus ###
+// GLUT window callback sub-API
   glutDisplayFunc := GetProc(libglut, 'glutDisplayFunc');
   glutReshapeFunc := GetProc(libglut, 'glutReshapeFunc');
+  glutTimerFunc := GetProc(libglut, 'glutTimerFunc');
   glutKeyboardFunc := GetProc(libglut, 'glutKeyboardFunc');
-  glutMouseFunc := GetProc(libglut, 'glutMouseFunc');
-  glutMotionFunc := GetProc(libglut, 'glutMotionFunc');
-  glutPassiveMotionFunc := GetProc(libglut, 'glutPassiveMotionFunc');
-  glutEntryFunc := GetProc(libglut, 'glutEntryFunc');
   glutIdleFunc := GetProc(libglut, 'glutIdleFunc');
-  glutTimerFunc := GetProc(libglut, 'glutTimerFunc');
-  glutMenuStateFunc := GetProc(libglut, 'glutMenuStateFunc');
-  glutSpecialFunc := GetProc(libglut, 'glutSpecialFunc');
-  glutSpaceballMotionFunc := GetProc(libglut, 'glutSpaceballMotionFunc');
-  glutSpaceballRotateFunc := GetProc(libglut, 'glutSpaceballRotateFunc');
-  glutSpaceballButtonFunc := GetProc(libglut, 'glutSpaceballButtonFunc');
-  glutButtonBoxFunc := GetProc(libglut, 'glutButtonBoxFunc');
-  glutDialsFunc := GetProc(libglut, 'glutDialsFunc');
-  glutTabletMotionFunc := GetProc(libglut, 'glutTabletMotionFunc');
-  glutTabletButtonFunc := GetProc(libglut, 'glutTabletButtonFunc');
-  glutMenuStatusFunc := GetProc(libglut, 'glutMenuStatusFunc');
-  glutOverlayDisplayFunc := GetProc(libglut, 'glutOverlayDisplayFunc');
-  glutWindowStatusFunc := GetProc(libglut, 'glutWindowStatusFunc');
-  glutKeyboardUpFunc := GetProc(libglut, 'glutKeyboardUpFunc');
-  glutSpecialUpFunc := GetProc(libglut, 'glutSpecialUpFunc');
-  glutJoystickFunc := GetProc(libglut, 'glutJoystickFunc');
+  glutVisibilityFunc := GetProc(libglut, 'glutVisibilityFunc');
+// 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));
+// GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y));
+// GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK * func)(int key, int x, int y));
+// GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK * func)(unsigned int buttonMask, int x, int y, int z), int pollInterval)
+// GLUT color index sub-API
   glutSetColor := GetProc(libglut, 'glutSetColor');
   glutGetColor := GetProc(libglut, 'glutGetColor');
   glutCopyColormap := GetProc(libglut, 'glutCopyColormap');
+// GLUT state retrieval sub-API
   glutGet := GetProc(libglut, 'glutGet');
   glutDeviceGet := GetProc(libglut, 'glutDeviceGet');
   glutExtensionSupported := GetProc(libglut, 'glutExtensionSupported');
   glutGetModifiers := GetProc(libglut, 'glutGetModifiers');
   glutLayerGet := GetProc(libglut, 'glutLayerGet');
-  glutBitmapCharacter := GetProc(libglut, 'glutBitmapCharacter');
-  glutBitmapWidth := GetProc(libglut, 'glutBitmapWidth');
-  glutStrokeCharacter := GetProc(libglut, 'glutStrokeCharacter');
-  glutStrokeWidth := GetProc(libglut, 'glutStrokeWidth');
-  glutBitmapLength := GetProc(libglut, 'glutBitmapLength');
-  glutStrokeLength := GetProc(libglut, 'glutStrokeLength');
-  glutWireSphere := GetProc(libglut, 'glutWireSphere');
-  glutSolidSphere := GetProc(libglut, 'glutSolidSphere');
-  glutWireCone := GetProc(libglut, 'glutWireCone');
-  glutSolidCone := GetProc(libglut, 'glutSolidCone');
-  glutWireCube := GetProc(libglut, 'glutWireCube');
-  glutSolidCube := GetProc(libglut, 'glutSolidCube');
-  glutWireTorus := GetProc(libglut, 'glutWireTorus');
-  glutSolidTorus := GetProc(libglut, 'glutSolidTorus');
-  glutWireDodecahedron := GetProc(libglut, 'glutWireDodecahedron');
-  glutSolidDodecahedron := GetProc(libglut, 'glutSolidDodecahedron');
-  glutWireTeapot := GetProc(libglut, 'glutWireTeapot');
-  glutSolidTeapot := GetProc(libglut, 'glutSolidTeapot');
-  glutWireOctahedron := GetProc(libglut, 'glutWireOctahedron');
-  glutSolidOctahedron := GetProc(libglut, 'glutSolidOctahedron');
-  glutWireTetrahedron := GetProc(libglut, 'glutWireTetrahedron');
-  glutSolidTetrahedron := GetProc(libglut, 'glutSolidTetrahedron');
-  glutWireIcosahedron := GetProc(libglut, 'glutWireIcosahedron');
-  glutSolidIcosahedron := GetProc(libglut, 'glutSolidIcosahedron');
-  glutVideoResizeGet := GetProc(libglut, 'glutVideoResizeGet');
-  glutSetupVideoResizing := GetProc(libglut, 'glutSetupVideoResizing');
-  glutStopVideoResizing := GetProc(libglut, 'glutStopVideoResizing');
-  glutVideoResize := GetProc(libglut, 'glutVideoResize');
-  glutVideoPan := GetProc(libglut, 'glutVideoPan');
-  glutReportErrors := GetProc(libglut, 'glutReportErrors');
-  glutIgnoreKeyRepeat := GetProc(libglut, 'glutIgnoreKeyRepeat');
-  glutSetKeyRepeat := GetProc(libglut, 'glutSetKeyRepeat');
-  glutForceJoystickFunc := GetProc(libglut, 'glutForceJoystickFunc');
+// fonts ###
+// pre-built models ###
+// video resize ###
+// debugging ###
+// device control ###
+// GLUT game mode sub-API
+{$ifdef GLUT_GAME}
   glutGameModeString := GetProc(libglut, 'glutGameModeString');
   glutEnterGameMode := GetProc(libglut, 'glutEnterGameMode');
   glutLeaveGameMode := GetProc(libglut, 'glutLeaveGameMode');
   glutGameModeGet := GetProc(libglut, 'glutGameModeGet');
+{$endif GLUT_GAME}
 
   GLUTInitialized := True;
   Result := True;
@@ -628,20 +437,21 @@ end;
 
 function InitGLUT: Boolean;
 begin
-  Result := InitGLUTFromLibrary('libglut.so') or InitGLUTFromLibrary('libglut.so.3');
+  Result := InitGLUTFromLibrary('libglut.so') or
+            InitGLUTFromLibrary('libglut.so.3');
 end;
 
 
-
+initialization
+  InitGLUT;
 finalization
-  if Assigned(libGLUT) then
-    FreeLibrary(libGLUT);
+  if Assigned(libGLUT) then dlClose(libGLUT);
 end.
 
 
 {
   $Log$
-  Revision 1.2  2000-07-13 11:33:29  michael
-  + removed logs
- 
+  Revision 1.4.2.1  2000-10-01 22:12:28  peter
+    * new demo
+
 }

+ 266 - 0
packages/opengl/linux/glx.pp

@@ -0,0 +1,266 @@
+{
+  $Id$
+
+  Translation of the Mesa GLX headers for FreePascal
+  Copyright (C) 1999 Sebastian Guenther
+
+
+  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.
+}
+
+{$MODE delphi}  // objfpc would not work because of direct proc var assignments
+
+{You have to enable Macros (compiler switch "-Sm") for compiling this unit!
+ This is necessary for supporting different platforms with different calling
+ conventions via a single unit.}
+
+unit GLX;
+
+interface
+
+{$MACRO ON}
+
+{$IFDEF Linux}
+  uses
+    X, XLib, XUtil;
+  {$DEFINE HasGLX}  // Activate GLX stuff
+{$ELSE}
+  {$MESSAGE Unsupported platform.}
+{$ENDIF}
+
+{$IFNDEF HasGLX}
+  {$MESSAGE GLX not present on this platform.}
+{$ENDIF}
+
+
+// =======================================================
+//   Unit specific extensions
+// =======================================================
+
+// Note: Requires that the GL library has already been initialized
+function InitGLX: Boolean;
+
+var
+  GLXDumpUnresolvedFunctions,
+  GLXInitialized: Boolean;
+
+
+// =======================================================
+//   GLX consts, types and functions
+// =======================================================
+
+// Tokens for glXChooseVisual and glXGetConfig:
+const
+  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                 = $22;
+  GLX_TRANSPARENT_TYPE_EXT              = $23;
+  GLX_TRANSPARENT_INDEX_VALUE_EXT       = $24;
+  GLX_TRANSPARENT_RED_VALUE_EXT         = $25;
+  GLX_TRANSPARENT_GREEN_VALUE_EXT       = $26;
+  GLX_TRANSPARENT_BLUE_VALUE_EXT        = $27;
+  GLX_TRANSPARENT_ALPHA_VALUE_EXT       = $28;
+
+
+  // Error codes returned by glXGetConfig:
+  GLX_BAD_SCREEN                        = 1;
+  GLX_BAD_ATTRIBUTE                     = 2;
+  GLX_NO_EXTENSION                      = 3;
+  GLX_BAD_VISUAL                        = 4;
+  GLX_BAD_CONTEXT                       = 5;
+  GLX_BAD_VALUE                         = 6;
+  GLX_BAD_ENUM                          = 7;
+
+  // GLX 1.1 and later:
+  GLX_VENDOR                            = 1;
+  GLX_VERSION                           = 2;
+  GLX_EXTENSIONS                        = 3;
+
+  // GLX_visual_info extension
+  GLX_TRUE_COLOR_EXT                    = $8002;
+  GLX_DIRECT_COLOR_EXT                  = $8003;
+  GLX_PSEUDO_COLOR_EXT                  = $8004;
+  GLX_STATIC_COLOR_EXT                  = $8005;
+  GLX_GRAY_SCALE_EXT                    = $8006;
+  GLX_STATIC_GRAY_EXT                   = $8007;
+  GLX_NONE_EXT                          = $8000;
+  GLX_TRANSPARENT_RGB_EXT               = $8008;
+  GLX_TRANSPARENT_INDEX_EXT             = $8009;
+
+type
+  // From XLib:
+  XPixmap = TXID;
+  XFont = TXID;
+  XColormap = TXID;
+
+  GLXContext = Pointer;
+  GLXPixmap = TXID;
+  GLXDrawable = TXID;
+  GLXContextID = TXID;
+
+var
+  glXChooseVisual: function(dpy: PDisplay; screen: Integer; var attribList: Integer): PXVisualInfo; cdecl; cdecl;
+  glXCreateContext: function(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext; cdecl; cdecl;
+  glXDestroyContext: procedure(dpy: PDisplay; ctx: GLXContext); cdecl; cdecl;
+  glXMakeCurrent: function(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): Boolean; cdecl; cdecl;
+  glXCopyContext: procedure(dpy: PDisplay; src, dst: GLXContext; mask: LongWord); cdecl; cdecl;
+  glXSwapBuffers: procedure(dpy: PDisplay; drawable: GLXDrawable); cdecl; cdecl;
+  glXCreateGLXPixmap: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap): GLXPixmap; cdecl; cdecl;
+  glXDestroyGLXPixmap: procedure(dpy: PDisplay; pixmap: GLXPixmap); cdecl; cdecl;
+  glXQueryExtension: function(dpy: PDisplay; var errorb, event: Integer): Boolean; cdecl; cdecl;
+  glXQueryVersion: function(dpy: PDisplay; var maj, min: Integer): Boolean; cdecl; cdecl;
+  glXIsDirect: function(dpy: PDisplay; ctx: GLXContext): Boolean; cdecl; cdecl;
+  glXGetConfig: function(dpy: PDisplay; visual: PXVisualInfo; attrib: Integer; var value: Integer): Integer; cdecl; cdecl;
+  glXGetCurrentContext: function: GLXContext; cdecl; cdecl;
+  glXGetCurrentDrawable: function: GLXDrawable; cdecl; cdecl;
+  glXWaitGL: procedure; cdecl; cdecl;
+  glXWaitX: procedure; cdecl; cdecl;
+  glXUseXFont: procedure(font: XFont; first, count, list: Integer); cdecl; cdecl;
+
+  // GLX 1.1 and later
+  glXQueryExtensionsString: function(dpy: PDisplay; screen: Integer): PChar; cdecl; cdecl;
+  glXQueryServerString: function(dpy: PDisplay; screen, name: Integer): PChar; cdecl; cdecl;
+  glXGetClientString: function(dpy: PDisplay; name: Integer): PChar; cdecl; cdecl;
+
+  // Mesa GLX Extensions
+  glXCreateGLXPixmapMESA: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl; cdecl;
+  glXReleaseBufferMESA: function(dpy: PDisplay; d: GLXDrawable): Boolean; cdecl; cdecl;
+  glXCopySubBufferMESA: procedure(dpy: PDisplay; drawbale: GLXDrawable; x, y, width, height: Integer); cdecl; cdecl;
+  glXGetVideoSyncSGI: function(var counter: LongWord): Integer; cdecl; cdecl;
+  glXWaitVideoSyncSGI: function(divisor, remainder: Integer; var count: LongWord): Integer; cdecl; cdecl;
+
+
+// =======================================================
+//
+// =======================================================
+
+implementation
+
+{$LINKLIB m}
+
+function dlopen(AFile: PChar; mode: LongInt): Pointer; external 'dl';
+function dlclose(handle: Pointer): LongInt; external 'dl';
+function dlsym(handle: Pointer; name: PChar): Pointer; external 'dl';
+
+function LoadLibrary(name: PChar): Pointer;
+begin
+  Result := dlopen(name, $101 {RTLD_GLOBAL or RTLD_LAZY});
+end;
+
+function GetProc(handle: Pointer; name: PChar): Pointer;
+begin
+  Result := dlsym(handle, name);
+  if (Result = nil) and GLXDumpUnresolvedFunctions then
+    WriteLn('Unresolved: ', name);
+end;
+
+var
+  libGLX: Pointer;
+
+function InitGLXFromLibrary(libname:pchar): Boolean;
+begin
+  Result := False;
+  libGLX := LoadLibrary(libname);
+  if not Assigned(libGLX) then exit;
+
+  glXChooseVisual := GetProc(libglx, 'glXChooseVisual');
+  glXCreateContext := GetProc(libglx, 'glXCreateContext');
+  glXDestroyContext := GetProc(libglx, 'glXDestroyContext');
+  glXMakeCurrent := GetProc(libglx, 'glXMakeCurrent');
+  glXCopyContext := GetProc(libglx, 'glXCopyContext');
+  glXSwapBuffers := GetProc(libglx, 'glXSwapBuffers');
+  glXCreateGLXPixmap := GetProc(libglx, 'glXCreateGLXPixmap');
+  glXDestroyGLXPixmap := GetProc(libglx, 'glXDestroyGLXPixmap');
+  glXQueryExtension := GetProc(libglx, 'glXQueryExtension');
+  glXQueryVersion := GetProc(libglx, 'glXQueryVersion');
+  glXIsDirect := GetProc(libglx, 'glXIsDirect');
+  glXGetConfig := GetProc(libglx, 'glXGetConfig');
+  glXGetCurrentContext := GetProc(libglx, 'glXGetCurrentContext');
+  glXGetCurrentDrawable := GetProc(libglx, 'glXGetCurrentDrawable');
+  glXWaitGL := GetProc(libglx, 'glXWaitGL');
+  glXWaitX := GetProc(libglx, 'glXWaitX');
+  glXUseXFont := GetProc(libglx, 'glXUseXFont');
+  // GLX 1.1 and later
+  glXQueryExtensionsString := GetProc(libglx, 'glXQueryExtensionsString');
+  glXQueryServerString := GetProc(libglx, 'glXQueryServerString');
+  glXGetClientString := GetProc(libglx, 'glXGetClientString');
+  // Mesa GLX Extensions
+  glXCreateGLXPixmapMESA := GetProc(libglx, 'glXCreateGLXPixmapMESA');
+  glXReleaseBufferMESA := GetProc(libglx, 'glXReleaseBufferMESA');
+  glXCopySubBufferMESA := GetProc(libglx, 'glXCopySubBufferMESA');
+  glXGetVideoSyncSGI := GetProc(libglx, 'glXGetVideoSyncSGI');
+  glXWaitVideoSyncSGI := GetProc(libglx, 'glXWaitVideoSyncSGI');
+
+  GLXInitialized := True;
+  Result := True;
+end;
+
+function InitGLX: Boolean;
+begin
+  Result := InitGLXFromLibrary('libGL.so') or
+            InitGLXFromLibrary('libGL.so.1') or
+            InitGLXFromLibrary('libMesaGL.so') or
+            InitGLXFromLibrary('libMesaGL.so.3');
+end;
+
+
+initialization
+  InitGLX;
+finalization
+  if Assigned(libGLX) then dlclose(libGLX);
+end.
+
+
+{
+  $Log$
+  Revision 1.1.2.1  2000-10-01 22:12:28  peter
+    * new demo
+
+  Revision 1.1  2000/07/13 06:34:18  michael
+  + Initial import
+
+  Revision 1.1  2000/05/31 00:36:08  alex
+  dummy - incomplete code.
+
+}
+
+
+{
+  $Log$
+  Revision 1.1.2.1  2000-10-01 22:12:28  peter
+    * new demo
+
+}

+ 4 - 4
packages/opengl/win32/gl.pp

@@ -2032,8 +2032,8 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:40  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
   Revision 1.1  2000/09/03 21:25:45  peter
     * new updated version
@@ -2052,7 +2052,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:40  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 2 - 2
packages/opengl/win32/gl_sl.pp

@@ -1485,7 +1485,7 @@ END.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:40  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 2 - 2
packages/opengl/win32/glaux.pp

@@ -504,7 +504,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 2 - 2
packages/opengl/win32/glaux_sl.pp

@@ -504,7 +504,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 4 - 4
packages/opengl/win32/glu.pp

@@ -349,8 +349,8 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
   Revision 1.1  2000/07/13 06:34:18  michael
   + Initial import
@@ -363,7 +363,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 4 - 4
packages/opengl/win32/glu_sl.pp

@@ -260,8 +260,8 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
   Revision 1.1  2000/09/03 21:25:45  peter
     * new updated version
@@ -280,7 +280,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 6 - 4
packages/opengl/win32/glut.pp

@@ -174,6 +174,7 @@ type
   TGlutTimerFunc = procedure(value: Integer); extdecl
   TGlutKeyboardFunc = procedure(key: char;x,y:Integer); extdecl
   TGlutIdleFunc = procedure; extdecl
+  TGlutVisibilityFunc = procedure(state:Integer); extdecl
 
 // GLUT game mode sub-API
 {$ifdef GLUT_GAME}
@@ -190,7 +191,7 @@ const
 
 var
 // GLUT initialization sub-API
-  glutInit: procedure(var argcp: Integer; var argv: PChar); glut_dll
+  glutInit: procedure(argcp: PInteger; argv: PPChar); glut_dll
   glutInitDisplayMode: procedure(mode: LongWord); glut_dll
   glutInitDisplayString: procedure(AString: PChar); glut_dll
   glutInitWindowPosition: procedure(x, y: Integer); glut_dll
@@ -230,7 +231,7 @@ var
   glutTimerFunc: procedure(millis: LongWord; func: TGlutTimerFunc; value: longint); glut_dll
   glutKeyboardFunc : procedure(func: TGlutKeyboardFunc); glut_dll
   glutIdleFunc : procedure(func: TGlutIdleFunc); glut_dll
-
+  glutVisibilityFunc : procedure(func: TGlutVisibilityFunc); glut_dll
 
 // GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
 // GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
@@ -348,6 +349,7 @@ begin
   glutTimerFunc := GetProc(libGLUT, 'glutTimerFunc');
   glutKeyboardFunc := GetProc(libGLUT, 'glutKeyboardFunc');
   glutIdleFunc := GetProc(libGLUT, 'glutIdleFunc');
+  glutVisibilityFunc := GetProc(libGLUT, 'glutVisibilityFunc');
 // 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));
@@ -416,7 +418,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 5 - 4
packages/opengl/win32/glut_sl.pp

@@ -188,6 +188,7 @@ type
   TGlutTimerFunc = procedure(value: Integer); extdecl
   TGlutKeyboardFunc = procedure(key: char;x,y:Integer); extdecl
   TGlutIdleFunc = procedure; extdecl
+  TGlutVisibilityFunc = procedure(state:Integer); extdecl
 
 // GLUT game mode sub-API
 {$ifdef GLUT_GAME}
@@ -203,7 +204,7 @@ const
 {$endif GLUT_GAME}
 
 // GLUT initialization sub-API
-procedure glutInit(var argcp: Integer; var argv: PChar); glut_dll;
+procedure glutInit(argcp: PInteger; argv: PPChar); glut_dll;
 procedure glutInitDisplayMode(mode: LongWord); glut_dll;
 procedure glutInitDisplayString(AString: PChar); glut_dll;
 procedure glutInitWindowPosition(x, y: Integer); glut_dll;
@@ -243,7 +244,7 @@ procedure glutReshapeFunc(func: TGlutReshapeFunc); glut_dll;
 procedure glutTimerFunc(millis: LongWord; func: TGlutTimerFunc; value: longint); glut_dll;
 procedure glutKeyboardFunc(func: TGlutKeyboardFunc); glut_dll;
 procedure glutIdleFunc(func: TGlutIdleFunc); glut_dll;
-
+procedure glutVisibilityFunc(func: TGlutVisibilityFunc); glut_dll;
 
 // GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void));
 // GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height));
@@ -312,7 +313,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 4 - 4
packages/opengl/win32/glx.pp

@@ -237,8 +237,8 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
   Revision 1.1  2000/07/13 06:34:18  michael
   + Initial import
@@ -251,7 +251,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

+ 4 - 4
packages/opengl/win32/glx_sl.pp

@@ -166,8 +166,8 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
   Revision 1.1  2000/09/03 21:25:45  peter
     * new updated version
@@ -186,7 +186,7 @@ end.
 
 {
   $Log$
-  Revision 1.1.2.1  2000-09-03 22:14:41  peter
-    * regenerated
+  Revision 1.1.2.2  2000-10-01 22:12:28  peter
+    * new demo
 
 }

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor