'
' GLUT definitions based on FreeGLUT - their license below.
'
' Ported to BaCon INCLUDE file by Peter van Eerten - GPL.
'
' Version 1.0: Initial release
' Version 1.1: Added heuristic library search
' Version 1.2: Compatibility with MacOSX
' Version 1.3: Compatibility with the original GLUT from Mark Kilgard
' Version 1.4: Compatibility with Cygwin/X
' Version 1.5: Updated for BaCon 3.x
'
' freeglut_std.h
'
' The GLUT-compatible part of the freeglut library include file
'
' Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
' Written by Pawel W. Olszta, <olszta@sourceforge.net>
' Creation date: Thu Dec 2 1999
'
' 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
' PAWEL W. OLSZTA 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.
'
CATCH GOTO glut_handle_error

IF INSTR(OS$, "Darwin") THEN
    glut_LIB$="/System/Library/Frameworks/GLUT.framework/GLUT"
ELIF INSTR(OS$, "CYGWIN") THEN
    glut_LIB$ = "cygglut-3.dll"
ELSE
    glut_LIB$ = "libglut.so"
END IF

glut_seq = -1

LABEL glut_import_retry
    INCR glut_seq
    glut_retry = FALSE
    IMPORT "glutInit(long,long)" FROM glut_LIB$ TYPE void
    IF glut_retry THEN GOTO glut_import_retry

GOTO glut_continue

LABEL glut_handle_error
    IF glut_seq IS 0 THEN glut_LIB$ = "libglut.so.0"
    ELSE glut_LIB$ = CONCAT$(LEFT$(glut_LIB$, INSTRREV(glut_LIB$, ".")), STR$(glut_seq))
    IF glut_seq < 10 THEN
        glut_retry = TRUE
    ELSE
        PRINT "No GLUT library found!"
        END
    END IF
    RESUME

LABEL glut_continue

' Fonts
IMPORT "glutStrokeRoman" FROM glut_LIB$ TYPE void
IMPORT "glutStrokeMonoRoman" FROM glut_LIB$ TYPE void
IMPORT "glutBitmap9By15" FROM glut_LIB$ TYPE void
IMPORT "glutBitmap8By13" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapTimesRoman10" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapTimesRoman24" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapHelvetica10" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapHelvetica12" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapHelvetica18" FROM glut_LIB$ TYPE void

CONST GLUT_STROKE_ROMAN = (long)glutStrokeRoman
CONST GLUT_STROKE_MONO_ROMAN = (long)glutStrokeMonoRoman
CONST GLUT_BITMAP_9_BY_15 = (long)glutBitmap9By15
CONST GLUT_BITMAP_8_BY_13 = (long)glutBitmap8By13
CONST GLUT_BITMAP_TIMES_ROMAN_10 = (long)glutBitmapTimesRoman10
CONST GLUT_BITMAP_TIMES_ROMAN_24 = (long)glutBitmapTimesRoman24
CONST GLUT_BITMAP_HELVETICA_10 = (long)glutBitmapHelvetica10
CONST GLUT_BITMAP_HELVETICA_12 = (long)glutBitmapHelvetica12
CONST GLUT_BITMAP_HELVETICA_18 = (long)glutBitmapHelvetica18

' Other functions
CONST FREEGLUT = 1
CONST GLUT_API_VERSION = 4
CONST FREEGLUT_VERSION_2_0 = 1
CONST GLUT_XLIB_IMPLEMENTATION = 13
CONST GLUT_KEY_F1 = 0x0001
CONST GLUT_KEY_F2 = 0x0002
CONST GLUT_KEY_F3 = 0x0003
CONST GLUT_KEY_F4 = 0x0004
CONST GLUT_KEY_F5 = 0x0005
CONST GLUT_KEY_F6 = 0x0006
CONST GLUT_KEY_F7 = 0x0007
CONST GLUT_KEY_F8 = 0x0008
CONST GLUT_KEY_F9 = 0x0009
CONST GLUT_KEY_F10 = 0x000A
CONST GLUT_KEY_F11 = 0x000B
CONST GLUT_KEY_F12 = 0x000C
CONST GLUT_KEY_LEFT = 0x0064
CONST GLUT_KEY_UP = 0x0065
CONST GLUT_KEY_RIGHT = 0x0066
CONST GLUT_KEY_DOWN = 0x0067
CONST GLUT_KEY_PAGE_UP = 0x0068
CONST GLUT_KEY_PAGE_DOWN = 0x0069
CONST GLUT_KEY_HOME = 0x006A
CONST GLUT_KEY_END = 0x006B
CONST GLUT_KEY_INSERT = 0x006C
CONST GLUT_LEFT_BUTTON = 0x0000
CONST GLUT_MIDDLE_BUTTON = 0x0001
CONST GLUT_RIGHT_BUTTON = 0x0002
CONST GLUT_DOWN = 0x0000
CONST GLUT_UP = 0x0001
CONST GLUT_LEFT = 0x0000
CONST GLUT_ENTERED = 0x0001
CONST GLUT_RGB = 0x0000
CONST GLUT_RGBA = 0x0000
CONST GLUT_INDEX = 0x0001
CONST GLUT_SINGLE = 0x0000
CONST GLUT_DOUBLE = 0x0002
CONST GLUT_ACCUM = 0x0004
CONST GLUT_ALPHA = 0x0008
CONST GLUT_DEPTH = 0x0010
CONST GLUT_STENCIL = 0x0020
CONST GLUT_MULTISAMPLE = 0x0080
CONST GLUT_STEREO = 0x0100
CONST GLUT_LUMINANCE = 0x0200
CONST GLUT_MENU_NOT_IN_USE = 0x0000
CONST GLUT_MENU_IN_USE = 0x0001
CONST GLUT_NOT_VISIBLE = 0x0000
CONST GLUT_VISIBLE = 0x0001
CONST GLUT_HIDDEN = 0x0000
CONST GLUT_FULLY_RETAINED = 0x0001
CONST GLUT_PARTIALLY_RETAINED = 0x0002
CONST GLUT_FULLY_COVERED = 0x0003
CONST GLUT_WINDOW_X = 0x0064
CONST GLUT_WINDOW_Y = 0x0065
CONST GLUT_WINDOW_WIDTH = 0x0066
CONST GLUT_WINDOW_HEIGHT = 0x0067
CONST GLUT_WINDOW_BUFFER_SIZE = 0x0068
CONST GLUT_WINDOW_STENCIL_SIZE = 0x0069
CONST GLUT_WINDOW_DEPTH_SIZE = 0x006A
CONST GLUT_WINDOW_RED_SIZE = 0x006B
CONST GLUT_WINDOW_GREEN_SIZE = 0x006C
CONST GLUT_WINDOW_BLUE_SIZE = 0x006D
CONST GLUT_WINDOW_ALPHA_SIZE = 0x006E
CONST GLUT_WINDOW_ACCUM_RED_SIZE = 0x006F
CONST GLUT_WINDOW_ACCUM_GREEN_SIZE = 0x0070
CONST GLUT_WINDOW_ACCUM_BLUE_SIZE = 0x0071
CONST GLUT_WINDOW_ACCUM_ALPHA_SIZE = 0x0072
CONST GLUT_WINDOW_DOUBLEBUFFER = 0x0073
CONST GLUT_WINDOW_RGBA = 0x0074
CONST GLUT_WINDOW_PARENT = 0x0075
CONST GLUT_WINDOW_NUM_CHILDREN = 0x0076
CONST GLUT_WINDOW_COLORMAP_SIZE = 0x0077
CONST GLUT_WINDOW_NUM_SAMPLES = 0x0078
CONST GLUT_WINDOW_STEREO = 0x0079
CONST GLUT_WINDOW_CURSOR = 0x007A
CONST GLUT_SCREEN_WIDTH = 0x00C8
CONST GLUT_SCREEN_HEIGHT = 0x00C9
CONST GLUT_SCREEN_WIDTH_MM = 0x00CA
CONST GLUT_SCREEN_HEIGHT_MM = 0x00CB
CONST GLUT_MENU_NUM_ITEMS = 0x012C
CONST GLUT_DISPLAY_MODE_POSSIBLE = 0x0190
CONST GLUT_INIT_WINDOW_X = 0x01F4
CONST GLUT_INIT_WINDOW_Y = 0x01F5
CONST GLUT_INIT_WINDOW_WIDTH = 0x01F6
CONST GLUT_INIT_WINDOW_HEIGHT = 0x01F7
CONST GLUT_INIT_DISPLAY_MODE = 0x01F8
CONST GLUT_ELAPSED_TIME = 0x02BC
CONST GLUT_WINDOW_FORMAT_ID = 0x007B
CONST GLUT_INIT_STATE = 0x007C
CONST GLUT_HAS_KEYBOARD = 0x0258
CONST GLUT_HAS_MOUSE = 0x0259
CONST GLUT_HAS_SPACEBALL = 0x025A
CONST GLUT_HAS_DIAL_AND_BUTTON_BOX = 0x025B
CONST GLUT_HAS_TABLET = 0x025C
CONST GLUT_NUM_MOUSE_BUTTONS = 0x025D
CONST GLUT_NUM_SPACEBALL_BUTTONS = 0x025E
CONST GLUT_NUM_BUTTON_BOX_BUTTONS = 0x025F
CONST GLUT_NUM_DIALS = 0x0260
CONST GLUT_NUM_TABLET_BUTTONS = 0x0261
CONST GLUT_DEVICE_IGNORE_KEY_REPEAT = 0x0262
CONST GLUT_DEVICE_KEY_REPEAT = 0x0263
CONST GLUT_HAS_JOYSTICK = 0x0264
CONST GLUT_OWNS_JOYSTICK = 0x0265
CONST GLUT_JOYSTICK_BUTTONS = 0x0266
CONST GLUT_JOYSTICK_AXES = 0x0267
CONST GLUT_JOYSTICK_POLL_RATE = 0x0268
CONST GLUT_OVERLAY_POSSIBLE = 0x0320
CONST GLUT_LAYER_IN_USE = 0x0321
CONST GLUT_HAS_OVERLAY = 0x0322
CONST GLUT_TRANSPARENT_INDEX = 0x0323
CONST GLUT_NORMAL_DAMAGED = 0x0324
CONST GLUT_OVERLAY_DAMAGED = 0x0325
CONST GLUT_VIDEO_RESIZE_POSSIBLE = 0x0384
CONST GLUT_VIDEO_RESIZE_IN_USE = 0x0385
CONST GLUT_VIDEO_RESIZE_X_DELTA = 0x0386
CONST GLUT_VIDEO_RESIZE_Y_DELTA = 0x0387
CONST GLUT_VIDEO_RESIZE_WIDTH_DELTA = 0x0388
CONST GLUT_VIDEO_RESIZE_HEIGHT_DELTA = 0x0389
CONST GLUT_VIDEO_RESIZE_X = 0x038A
CONST GLUT_VIDEO_RESIZE_Y = 0x038B
CONST GLUT_VIDEO_RESIZE_WIDTH = 0x038C
CONST GLUT_VIDEO_RESIZE_HEIGHT = 0x038D
CONST GLUT_NORMAL = 0x0000
CONST GLUT_OVERLAY = 0x0001
CONST GLUT_ACTIVE_SHIFT = 0x0001
CONST GLUT_ACTIVE_CTRL = 0x0002
CONST GLUT_ACTIVE_ALT = 0x0004
CONST GLUT_CURSOR_RIGHT_ARROW = 0x0000
CONST GLUT_CURSOR_LEFT_ARROW = 0x0001
CONST GLUT_CURSOR_INFO = 0x0002
CONST GLUT_CURSOR_DESTROY = 0x0003
CONST GLUT_CURSOR_HELP = 0x0004
CONST GLUT_CURSOR_CYCLE = 0x0005
CONST GLUT_CURSOR_SPRAY = 0x0006
CONST GLUT_CURSOR_WAIT = 0x0007
CONST GLUT_CURSOR_TEXT = 0x0008
CONST GLUT_CURSOR_CROSSHAIR = 0x0009
CONST GLUT_CURSOR_UP_DOWN = 0x000A
CONST GLUT_CURSOR_LEFT_RIGHT = 0x000B
CONST GLUT_CURSOR_TOP_SIDE = 0x000C
CONST GLUT_CURSOR_BOTTOM_SIDE = 0x000D
CONST GLUT_CURSOR_LEFT_SIDE = 0x000E
CONST GLUT_CURSOR_RIGHT_SIDE = 0x000F
CONST GLUT_CURSOR_TOP_LEFT_CORNER = 0x0010
CONST GLUT_CURSOR_TOP_RIGHT_CORNER = 0x0011
CONST GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 0x0012
CONST GLUT_CURSOR_BOTTOM_LEFT_CORNER = 0x0013
CONST GLUT_CURSOR_INHERIT = 0x0064
CONST GLUT_CURSOR_NONE = 0x0065
CONST GLUT_CURSOR_FULL_CROSSHAIR = 0x0066
CONST GLUT_RED = 0x0000
CONST GLUT_GREEN = 0x0001
CONST GLUT_BLUE = 0x0002
CONST GLUT_KEY_REPEAT_OFF = 0x0000
CONST GLUT_KEY_REPEAT_ON = 0x0001
CONST GLUT_KEY_REPEAT_DEFAULT = 0x0002
CONST GLUT_JOYSTICK_BUTTON_A = 0x0001
CONST GLUT_JOYSTICK_BUTTON_B = 0x0002
CONST GLUT_JOYSTICK_BUTTON_C = 0x0004
CONST GLUT_JOYSTICK_BUTTON_D = 0x0008
CONST GLUT_GAME_MODE_ACTIVE = 0x0000
CONST GLUT_GAME_MODE_POSSIBLE = 0x0001
CONST GLUT_GAME_MODE_WIDTH = 0x0002
CONST GLUT_GAME_MODE_HEIGHT = 0x0003
CONST GLUT_GAME_MODE_PIXEL_DEPTH = 0x0004
CONST GLUT_GAME_MODE_REFRESH_RATE = 0x0005
CONST GLUT_GAME_MODE_DISPLAY_CHANGED = 0x0006

IMPORT "glutInitWindowPosition(int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutInitWindowSize(int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutInitDisplayMode(int)" FROM glut_LIB$ TYPE void
IMPORT "glutInitDisplayString(char*)" FROM glut_LIB$ TYPE void
IMPORT "glutMainLoop(void)" FROM glut_LIB$ TYPE void
IMPORT "glutCreateWindow(char*)" FROM glut_LIB$ TYPE int
IMPORT "glutCreateSubWindow(int,int,int,int,int)" FROM glut_LIB$ TYPE int
IMPORT "glutDestroyWindow(int)" FROM glut_LIB$ TYPE void
IMPORT "glutSetWindow(int)" FROM glut_LIB$ TYPE void
IMPORT "glutGetWindow(void)" FROM glut_LIB$ TYPE int
IMPORT "glutSetWindowTitle(char*)" FROM glut_LIB$ TYPE void
IMPORT "glutSetIconTitle(char*)" FROM glut_LIB$ TYPE void
IMPORT "glutReshapeWindow(int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutPositionWindow(int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutShowWindow(void)" FROM glut_LIB$ TYPE void
IMPORT "glutHideWindow(void)" FROM glut_LIB$ TYPE void
IMPORT "glutIconifyWindow(void)" FROM glut_LIB$ TYPE void
IMPORT "glutPushWindow(void)" FROM glut_LIB$ TYPE void
IMPORT "glutPopWindow(void)" FROM glut_LIB$ TYPE void
IMPORT "glutFullScreen(void)" FROM glut_LIB$ TYPE void
IMPORT "glutPostWindowRedisplay(int)" FROM glut_LIB$ TYPE void
IMPORT "glutPostRedisplay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutSwapBuffers(void)" FROM glut_LIB$ TYPE void
IMPORT "glutWarpPointer(int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutSetCursor(int)" FROM glut_LIB$ TYPE void
IMPORT "glutEstablishOverlay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutRemoveOverlay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutUseLayer(int)" FROM glut_LIB$ TYPE void
IMPORT "glutPostOverlayRedisplay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutPostWindowOverlayRedisplay(int)" FROM glut_LIB$ TYPE void
IMPORT "glutShowOverlay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutHideOverlay(void)" FROM glut_LIB$ TYPE void
IMPORT "glutCreateMenu(long)" FROM glut_LIB$ TYPE int
IMPORT "glutDestroyMenu(int)" FROM glut_LIB$ TYPE void
IMPORT "glutGetMenu(void)" FROM glut_LIB$ TYPE int
IMPORT "glutSetMenu(int)" FROM glut_LIB$ TYPE void
IMPORT "glutAddMenuEntry(char*,int)" FROM glut_LIB$ TYPE void
IMPORT "glutAddSubMenu(char*,int)" FROM glut_LIB$ TYPE void
IMPORT "glutChangeToMenuEntry(int,char*,int)" FROM glut_LIB$ TYPE void
IMPORT "glutChangeToSubMenu(int,char*,int)" FROM glut_LIB$ TYPE void
IMPORT "glutRemoveMenuItem(int)" FROM glut_LIB$ TYPE void
IMPORT "glutAttachMenu(int)" FROM glut_LIB$ TYPE void
IMPORT "glutDetachMenu(int)" FROM glut_LIB$ TYPE void
IMPORT "glutTimerFunc(int,long,int)" FROM glut_LIB$ TYPE void
IMPORT "glutIdleFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutKeyboardFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutSpecialFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutReshapeFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutVisibilityFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutDisplayFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutMouseFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutMotionFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutPassiveMotionFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutEntryFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutKeyboardUpFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutSpecialUpFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutJoystickFunc(long,int)" FROM glut_LIB$ TYPE void
IMPORT "glutMenuStateFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutMenuStatusFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutOverlayDisplayFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutWindowStatusFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutSpaceballMotionFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutSpaceballRotateFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutSpaceballButtonFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutButtonBoxFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutDialsFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutTabletMotionFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutTabletButtonFunc(long)" FROM glut_LIB$ TYPE void
IMPORT "glutGet(int)" FROM glut_LIB$ TYPE int
IMPORT "glutDeviceGet(int)" FROM glut_LIB$ TYPE int
IMPORT "glutGetModifiers(void)" FROM glut_LIB$ TYPE int
IMPORT "glutLayerGet(int)" FROM glut_LIB$ TYPE int
IMPORT "glutBitmapCharacter(long,int)" FROM glut_LIB$ TYPE void
IMPORT "glutBitmapWidth(long,int)" FROM glut_LIB$ TYPE int
IMPORT "glutStrokeCharacter(long,int)" FROM glut_LIB$ TYPE void
IMPORT "glutStrokeWidth(long,int)" FROM glut_LIB$ TYPE int
IMPORT "glutBitmapLength(long,char*)" FROM glut_LIB$ TYPE int
IMPORT "glutStrokeLength(long,char*)" FROM glut_LIB$ TYPE int
IMPORT "glutWireCube(double)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidCube(double)" FROM glut_LIB$ TYPE void
IMPORT "glutWireSphere(double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidSphere(double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutWireCone(double,double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidCone(double,double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutWireTorus(double,double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidTorus(double,double,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutWireDodecahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidDodecahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutWireOctahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidOctahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutWireTetrahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidTetrahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutWireIcosahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidIcosahedron(void)" FROM glut_LIB$ TYPE void
IMPORT "glutWireTeapot(double)" FROM glut_LIB$ TYPE void
IMPORT "glutSolidTeapot(double)" FROM glut_LIB$ TYPE void
IMPORT "glutGameModeString(char*)" FROM glut_LIB$ TYPE void
IMPORT "glutEnterGameMode(void)" FROM glut_LIB$ TYPE int
IMPORT "glutLeaveGameMode(void)" FROM glut_LIB$ TYPE void
IMPORT "glutGameModeGet(int)" FROM glut_LIB$ TYPE int
IMPORT "glutVideoResizeGet(int)" FROM glut_LIB$ TYPE int
IMPORT "glutSetupVideoResizing(void)" FROM glut_LIB$ TYPE void
IMPORT "glutStopVideoResizing(void)" FROM glut_LIB$ TYPE void
IMPORT "glutVideoResize(int,int,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutVideoPan(int,int,int,int)" FROM glut_LIB$ TYPE void
IMPORT "glutSetColor(int,float,float,float)" FROM glut_LIB$ TYPE void
IMPORT "glutGetColor(int,int)" FROM glut_LIB$ TYPE float
IMPORT "glutCopyColormap(int)" FROM glut_LIB$ TYPE void
IMPORT "glutIgnoreKeyRepeat(int)" FROM glut_LIB$ TYPE void
IMPORT "glutSetKeyRepeat(int)" FROM glut_LIB$ TYPE void
IMPORT "glutForceJoystickFunc(void)" FROM glut_LIB$ TYPE void
IMPORT "glutExtensionSupported(char*)" FROM glut_LIB$ TYPE int
IMPORT "glutReportErrors(void)" FROM glut_LIB$ TYPE void

CATCH RESET

' Always initialize GLUT
glutInit(ADDRESS(argc), ADDRESS(argv))