# Newlisp FreeGLUT context. # # This file contains FreeGLUT constants and functions. # Created for FreeGLUT 2.4.0. # # Version 1.0: -Initial release (aug 18, 2005) # Version 1.1: -Rewrote callback registering functions (nov 20, 2005) # -Added checks to adding callback signals (nov 20, 2005) # -Treat NULL callbacks differently (nov 20, 2005) # -Added support for mousewheel and joystick (nov 20, 2005) # Version 1.2: -Adapted for newLisp10 (jan 1, 2009) # #--------------------------------------------------------- # This is the GLUT compatibility layer (context 'GLUT) # Determine which library to use first. (if (= ostype "Win32") (begin (constant 'GLUT_LIB "freeglut.dll") # Determine font names (constant 'GLUT_STROKE_ROMAN 0) (constant 'GLUT_STROKE_MONO_ROMAN 1) (constant 'GLUT_BITMAP_9_BY_15 2) (constant 'GLUT_BITMAP_8_BY_13 3) (constant 'GLUT_BITMAP_TIMES_ROMAN_10 4) (constant 'GLUT_BITMAP_TIMES_ROMAN_24 5) (constant 'GLUT_BITMAP_HELVETICA_10 6) (constant 'GLUT_BITMAP_HELVETICA_12 7) (constant 'GLUT_BITMAP_HELVETICA_18 8) ) (= ostype "Linux") (begin (constant 'GLUT_LIB "./freeglut.so") # Determine font names (import GLUT_LIB "glutStrokeRoman") (import GLUT_LIB "glutStrokeMonoRoman") (import GLUT_LIB "glutBitmap9By15") (import GLUT_LIB "glutBitmap8By13") (import GLUT_LIB "glutBitmapTimesRoman10") (import GLUT_LIB "glutBitmapTimesRoman24") (import GLUT_LIB "glutBitmapHelvetica10") (import GLUT_LIB "glutBitmapHelvetica12") (import GLUT_LIB "glutBitmapHelvetica18") (constant 'GLUT_STROKE_ROMAN (address glutStrokeRoman)) (constant 'GLUT_STROKE_MONO_ROMAN (address glutStrokeMonoRoman)) (constant 'GLUT_BITMAP_9_BY_15 (address glutBitmap9By15)) (constant 'GLUT_BITMAP_8_BY_13 (address glutBitmap8By13)) (constant 'GLUT_BITMAP_TIMES_ROMAN_10 (address glutBitmapTimesRoman10)) (constant 'GLUT_BITMAP_TIMES_ROMAN_24 (address glutBitmapTimesRoman24)) (constant 'GLUT_BITMAP_HELVETICA_10 (address glutBitmapHelvetica10)) (constant 'GLUT_BITMAP_HELVETICA_12 (address glutBitmapHelvetica12)) (constant 'GLUT_BITMAP_HELVETICA_18 (address glutBitmapHelvetica18)) ) ) # Define global empty list containing names of callback routines (set 'callbacks (dup . 256)) # Define the counters (set 'display_counter 0) (set 'overlaydisplay_counter 8) (set 'reshape_counter 16) (set 'keyboard_counter 24) (set 'mouse_counter 32) (set 'motion_counter 40) (set 'passivemotion_counter 48) (set 'visibility_counter 56) (set 'entry_counter 64) (set 'special_counter 72) (set 'spaceballmotion_counter 80) (set 'spaceballrotate_counter 88) (set 'spaceballbutton_counter 96) (set 'buttonbox_counter 104) (set 'dials_counter 112) (set 'tabletmotion_counter 120) (set 'tabletbutton_counter 128) (set 'timer_counter 136) (set 'menu_counter 144) (set 'mui_counter 156) (set 'mousewheel_counter 188) (set 'joystick_counter 196) # freeglut.h (constant 'FREEGLUT 1) (constant 'GLUT_API_VERSION 4) (constant 'FREEGLUT_VERSION_2_0 1) (constant 'GLUT_XLIB_IMPLEMENTATION 13) (constant 'GLUT_KEY_F1 0x0001) (constant 'GLUT_KEY_F2 0x0002) (constant 'GLUT_KEY_F3 0x0003) (constant 'GLUT_KEY_F4 0x0004) (constant 'GLUT_KEY_F5 0x0005) (constant 'GLUT_KEY_F6 0x0006) (constant 'GLUT_KEY_F7 0x0007) (constant 'GLUT_KEY_F8 0x0008) (constant 'GLUT_KEY_F9 0x0009) (constant 'GLUT_KEY_F10 0x000A) (constant 'GLUT_KEY_F11 0x000B) (constant 'GLUT_KEY_F12 0x000C) (constant 'GLUT_KEY_LEFT 0x0064) (constant 'GLUT_KEY_UP 0x0065) (constant 'GLUT_KEY_RIGHT 0x0066) (constant 'GLUT_KEY_DOWN 0x0067) (constant 'GLUT_KEY_PAGE_UP 0x0068) (constant 'GLUT_KEY_PAGE_DOWN 0x0069) (constant 'GLUT_KEY_HOME 0x006A) (constant 'GLUT_KEY_END 0x006B) (constant 'GLUT_KEY_INSERT 0x006C) (constant 'GLUT_LEFT_BUTTON 0x0000) (constant 'GLUT_MIDDLE_BUTTON 0x0001) (constant 'GLUT_RIGHT_BUTTON 0x0002) (constant 'GLUT_DOWN 0x0000) (constant 'GLUT_UP 0x0001) (constant 'GLUT_LEFT 0x0000) (constant 'GLUT_ENTERED 0x0001) (constant 'GLUT_RGB 0x0000) (constant 'GLUT_RGBA 0x0000) (constant 'GLUT_INDEX 0x0001) (constant 'GLUT_SINGLE 0x0000) (constant 'GLUT_DOUBLE 0x0002) (constant 'GLUT_ACCUM 0x0004) (constant 'GLUT_ALPHA 0x0008) (constant 'GLUT_DEPTH 0x0010) (constant 'GLUT_STENCIL 0x0020) (constant 'GLUT_MULTISAMPLE 0x0080) (constant 'GLUT_STEREO 0x0100) (constant 'GLUT_LUMINANCE 0x0200) (constant 'GLUT_MENU_NOT_IN_USE 0x0000) (constant 'GLUT_MENU_IN_USE 0x0001) (constant 'GLUT_NOT_VISIBLE 0x0000) (constant 'GLUT_VISIBLE 0x0001) (constant 'GLUT_HIDDEN 0x0000) (constant 'GLUT_FULLY_RETAINED 0x0001) (constant 'GLUT_PARTIALLY_RETAINED 0x0002) (constant 'GLUT_FULLY_COVERED 0x0003) (constant 'GLUT_WINDOW_X 0x0064) (constant 'GLUT_WINDOW_Y 0x0065) (constant 'GLUT_WINDOW_WIDTH 0x0066) (constant 'GLUT_WINDOW_HEIGHT 0x0067) (constant 'GLUT_WINDOW_BUFFER_SIZE 0x0068) (constant 'GLUT_WINDOW_STENCIL_SIZE 0x0069) (constant 'GLUT_WINDOW_DEPTH_SIZE 0x006A) (constant 'GLUT_WINDOW_RED_SIZE 0x006B) (constant 'GLUT_WINDOW_GREEN_SIZE 0x006C) (constant 'GLUT_WINDOW_BLUE_SIZE 0x006D) (constant 'GLUT_WINDOW_ALPHA_SIZE 0x006E) (constant 'GLUT_WINDOW_ACCUM_RED_SIZE 0x006F) (constant 'GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070) (constant 'GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071) (constant 'GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072) (constant 'GLUT_WINDOW_DOUBLEBUFFER 0x0073) (constant 'GLUT_WINDOW_RGBA 0x0074) (constant 'GLUT_WINDOW_PARENT 0x0075) (constant 'GLUT_WINDOW_NUM_CHILDREN 0x0076) (constant 'GLUT_WINDOW_COLORMAP_SIZE 0x0077) (constant 'GLUT_WINDOW_NUM_SAMPLES 0x0078) (constant 'GLUT_WINDOW_STEREO 0x0079) (constant 'GLUT_WINDOW_CURSOR 0x007A) (constant 'GLUT_SCREEN_WIDTH 0x00C8) (constant 'GLUT_SCREEN_HEIGHT 0x00C9) (constant 'GLUT_SCREEN_WIDTH_MM 0x00CA) (constant 'GLUT_SCREEN_HEIGHT_MM 0x00CB) (constant 'GLUT_MENU_NUM_ITEMS 0x012C) (constant 'GLUT_DISPLAY_MODE_POSSIBLE 0x0190) (constant 'GLUT_INIT_WINDOW_X 0x01F4) (constant 'GLUT_INIT_WINDOW_Y 0x01F5) (constant 'GLUT_INIT_WINDOW_WIDTH 0x01F6) (constant 'GLUT_INIT_WINDOW_HEIGHT 0x01F7) (constant 'GLUT_INIT_DISPLAY_MODE 0x01F8) (constant 'GLUT_ELAPSED_TIME 0x02BC) (constant 'GLUT_WINDOW_FORMAT_ID 0x007B) (constant 'GLUT_INIT_STATE 0x007C) (constant 'GLUT_HAS_KEYBOARD 0x0258) (constant 'GLUT_HAS_MOUSE 0x0259) (constant 'GLUT_HAS_SPACEBALL 0x025A) (constant 'GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B) (constant 'GLUT_HAS_TABLET 0x025C) (constant 'GLUT_NUM_MOUSE_BUTTONS 0x025D) (constant 'GLUT_NUM_SPACEBALL_BUTTONS 0x025E) (constant 'GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F) (constant 'GLUT_NUM_DIALS 0x0260) (constant 'GLUT_NUM_TABLET_BUTTONS 0x0261) (constant 'GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262) (constant 'GLUT_DEVICE_KEY_REPEAT 0x0263) (constant 'GLUT_HAS_JOYSTICK 0x0264) (constant 'GLUT_OWNS_JOYSTICK 0x0265) (constant 'GLUT_JOYSTICK_BUTTONS 0x0266) (constant 'GLUT_JOYSTICK_AXES 0x0267) (constant 'GLUT_JOYSTICK_POLL_RATE 0x0268) (constant 'GLUT_OVERLAY_POSSIBLE 0x0320) (constant 'GLUT_LAYER_IN_USE 0x0321) (constant 'GLUT_HAS_OVERLAY 0x0322) (constant 'GLUT_TRANSPARENT_INDEX 0x0323) (constant 'GLUT_NORMAL_DAMAGED 0x0324) (constant 'GLUT_OVERLAY_DAMAGED 0x0325) (constant 'GLUT_VIDEO_RESIZE_POSSIBLE 0x0384) (constant 'GLUT_VIDEO_RESIZE_IN_USE 0x0385) (constant 'GLUT_VIDEO_RESIZE_X_DELTA 0x0386) (constant 'GLUT_VIDEO_RESIZE_Y_DELTA 0x0387) (constant 'GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388) (constant 'GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389) (constant 'GLUT_VIDEO_RESIZE_X 0x038A) (constant 'GLUT_VIDEO_RESIZE_Y 0x038B) (constant 'GLUT_VIDEO_RESIZE_WIDTH 0x038C) (constant 'GLUT_VIDEO_RESIZE_HEIGHT 0x038D) (constant 'GLUT_NORMAL 0x0000) (constant 'GLUT_OVERLAY 0x0001) (constant 'GLUT_ACTIVE_SHIFT 0x0001) (constant 'GLUT_ACTIVE_CTRL 0x0002) (constant 'GLUT_ACTIVE_ALT 0x0004) (constant 'GLUT_CURSOR_RIGHT_ARROW 0x0000) (constant 'GLUT_CURSOR_LEFT_ARROW 0x0001) (constant 'GLUT_CURSOR_INFO 0x0002) (constant 'GLUT_CURSOR_DESTROY 0x0003) (constant 'GLUT_CURSOR_HELP 0x0004) (constant 'GLUT_CURSOR_CYCLE 0x0005) (constant 'GLUT_CURSOR_SPRAY 0x0006) (constant 'GLUT_CURSOR_WAIT 0x0007) (constant 'GLUT_CURSOR_TEXT 0x0008) (constant 'GLUT_CURSOR_CROSSHAIR 0x0009) (constant 'GLUT_CURSOR_UP_DOWN 0x000A) (constant 'GLUT_CURSOR_LEFT_RIGHT 0x000B) (constant 'GLUT_CURSOR_TOP_SIDE 0x000C) (constant 'GLUT_CURSOR_BOTTOM_SIDE 0x000D) (constant 'GLUT_CURSOR_LEFT_SIDE 0x000E) (constant 'GLUT_CURSOR_RIGHT_SIDE 0x000F) (constant 'GLUT_CURSOR_TOP_LEFT_CORNER 0x0010) (constant 'GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011) (constant 'GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012) (constant 'GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013) (constant 'GLUT_CURSOR_INHERIT 0x0064) (constant 'GLUT_CURSOR_NONE 0x0065) (constant 'GLUT_CURSOR_FULL_CROSSHAIR 0x0066) (constant 'GLUT_RED 0x0000) (constant 'GLUT_GREEN 0x0001) (constant 'GLUT_BLUE 0x0002) (constant 'GLUT_KEY_REPEAT_OFF 0x0000) (constant 'GLUT_KEY_REPEAT_ON 0x0001) (constant 'GLUT_KEY_REPEAT_DEFAULT 0x0002) (constant 'GLUT_JOYSTICK_BUTTON_A 0x0001) (constant 'GLUT_JOYSTICK_BUTTON_B 0x0002) (constant 'GLUT_JOYSTICK_BUTTON_C 0x0004) (constant 'GLUT_JOYSTICK_BUTTON_D 0x0008) (constant 'GLUT_GAME_MODE_ACTIVE 0x0000) (constant 'GLUT_GAME_MODE_POSSIBLE 0x0001) (constant 'GLUT_GAME_MODE_WIDTH 0x0002) (constant 'GLUT_GAME_MODE_HEIGHT 0x0003) (constant 'GLUT_GAME_MODE_PIXEL_DEPTH 0x0004) (constant 'GLUT_GAME_MODE_REFRESH_RATE 0x0005) (constant 'GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006) # ext.h (constant 'GLUT_ACTION_EXIT 0) (constant 'GLUT_ACTION_GLUTMAINLOOP_RETURNS 1) (constant 'GLUT_ACTION_CONTINUE_EXECUTION 2) (constant 'GLUT_CREATE_NEW_CONTEXT 0) (constant 'GLUT_USE_CURRENT_CONTEXT 1) (constant 'GLUT_FORCE_INDIRECT_CONTEXT 0) (constant 'GLUT_ALLOW_DIRECT_CONTEXT 1) (constant 'GLUT_TRY_DIRECT_CONTEXT 2) (constant 'GLUT_FORCE_DIRECT_CONTEXT 3) (constant 'GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9) (constant 'GLUT_WINDOW_BORDER_WIDTH 0x01FA) (constant 'GLUT_WINDOW_HEADER_HEIGHT 0x01FB) (constant 'GLUT_VERSION 0x01FC) (constant 'GLUT_RENDERING_CONTEXT 0x01FD) (constant 'GLUT_DIRECT_RENDERING 0x01FE) (constant 'GLUT_AUX1 0x1000) (constant 'GLUT_AUX2 0x2000) (constant 'GLUT_AUX3 0x4000) (constant 'GLUT_AUX4 0x8000) # mui.h (constant 'MUI_NO_ACTION 0) (constant 'MUI_SLIDER_MOVE 1) (constant 'MUI_SLIDER_RETURN 2) (constant 'MUI_SLIDER_SCROLLDOWN 3) (constant 'MUI_SLIDER_SCROLLUP 4) (constant 'MUI_SLIDER_THUMB 5) (constant 'MUI_BUTTON_PRESS 6) (constant 'MUI_TEXTBOX_RETURN 7) (constant 'MUI_TEXTLIST_RETURN 8) (constant 'MUI_TEXTLIST_RETURN_CONFIRM 9) # Functions (import GLUT_LIB "glutAddMenuEntry") (import GLUT_LIB "glutAddSubMenu") (import GLUT_LIB "glutAttachMenu") (import GLUT_LIB "glutBitmapCharacter") (import GLUT_LIB "glutBitmapHeight") (import GLUT_LIB "glutBitmapLength") (import GLUT_LIB "glutBitmapString") (import GLUT_LIB "glutBitmapWidth") (import GLUT_LIB "glutChangeToMenuEntry") (import GLUT_LIB "glutChangeToSubMenu") (import GLUT_LIB "glutCopyColormap") (import GLUT_LIB "glutCreateSubWindow") (import GLUT_LIB "glutCreateWindow") (import GLUT_LIB "glutDestroyWindow") (import GLUT_LIB "glutDetachMenu") (import GLUT_LIB "glutDeviceGet") (import GLUT_LIB "glutEnterGameMode") (import GLUT_LIB "glutEstablishOverlay") (import GLUT_LIB "glutExtensionSupported") (import GLUT_LIB "glutFullScreen") (import GLUT_LIB "glutGameModeGet") (import GLUT_LIB "glutGameModeString") (import GLUT_LIB "glutGet") (import GLUT_LIB "glutGetColor") (import GLUT_LIB "glutGetMenu") (import GLUT_LIB "glutGetMenuData") (import GLUT_LIB "glutGetModifiers") (import GLUT_LIB "glutGetProcAddress") (import GLUT_LIB "glutGetWindow") (import GLUT_LIB "glutGetWindowData") (import GLUT_LIB "glutHideOverlay") (import GLUT_LIB "glutHideWindow") (import GLUT_LIB "glutIconifyWindow") (import GLUT_LIB "glutIgnoreKeyRepeat") (import GLUT_LIB "glutInit") (import GLUT_LIB "glutInitDisplayMode") (import GLUT_LIB "glutInitDisplayString") (import GLUT_LIB "glutInitWindowPosition") (import GLUT_LIB "glutInitWindowSize") (import GLUT_LIB "glutLayerGet") (import GLUT_LIB "glutLeaveGameMode") (import GLUT_LIB "glutPopWindow") (import GLUT_LIB "glutPositionWindow") (import GLUT_LIB "glutPostOverlayRedisplay") (import GLUT_LIB "glutPostRedisplay") (import GLUT_LIB "glutPostWindowOverlayRedisplay") (import GLUT_LIB "glutPostWindowRedisplay") (import GLUT_LIB "glutPushWindow") (import GLUT_LIB "glutRemoveMenuItem") (import GLUT_LIB "glutRemoveOverlay") (import GLUT_LIB "glutReportErrors") (import GLUT_LIB "glutReshapeWindow") (import GLUT_LIB "glutSetColor") (import GLUT_LIB "glutSetCursor") (import GLUT_LIB "glutSetIconTitle") (import GLUT_LIB "glutSetKeyRepeat") (import GLUT_LIB "glutSetMenu") (import GLUT_LIB "glutSetMenuData") (import GLUT_LIB "glutSetOption") (import GLUT_LIB "glutSetWindow") (import GLUT_LIB "glutSetWindowData") (import GLUT_LIB "glutSetWindowTitle") (import GLUT_LIB "glutSetupVideoResizing") (import GLUT_LIB "glutShowOverlay") (import GLUT_LIB "glutShowWindow") (import GLUT_LIB "glutSolidCone") (import GLUT_LIB "glutSolidCube") (import GLUT_LIB "glutSolidCylinder") (import GLUT_LIB "glutSolidDodecahedron") (import GLUT_LIB "glutSolidIcosahedron") (import GLUT_LIB "glutSolidOctahedron") (import GLUT_LIB "glutSolidRhombicDodecahedron") (import GLUT_LIB "glutSolidSierpinskiSponge") (import GLUT_LIB "glutSolidSphere") (import GLUT_LIB "glutSolidTeapot") (import GLUT_LIB "glutSolidTetrahedron") (import GLUT_LIB "glutSolidTorus") (import GLUT_LIB "glutStopVideoResizing") (import GLUT_LIB "glutStrokeCharacter") (import GLUT_LIB "glutStrokeHeight") (import GLUT_LIB "glutStrokeLength") (import GLUT_LIB "glutStrokeString") (import GLUT_LIB "glutStrokeWidth") (import GLUT_LIB "glutSwapBuffers") (import GLUT_LIB "glutUseLayer") (import GLUT_LIB "glutVideoPan") (import GLUT_LIB "glutVideoResize") (import GLUT_LIB "glutVideoResizeGet") (import GLUT_LIB "glutWarpPointer") (import GLUT_LIB "glutWireCone") (import GLUT_LIB "glutWireCube") (import GLUT_LIB "glutWireCylinder") (import GLUT_LIB "glutWireDodecahedron") (import GLUT_LIB "glutWireIcosahedron") (import GLUT_LIB "glutWireOctahedron") (import GLUT_LIB "glutWireRhombicDodecahedron") (import GLUT_LIB "glutWireSierpinskiSponge") (import GLUT_LIB "glutWireSphere") (import GLUT_LIB "glutWireTeapot") (import GLUT_LIB "glutWireTetrahedron") (import GLUT_LIB "glutWireTorus") # These functions are needed for GLUT binding (import GLUT_LIB "reg_glutDisplayFunc") (import GLUT_LIB "reg_glutOverlayDisplayFunc") (import GLUT_LIB "reg_glutReshapeFunc") (import GLUT_LIB "reg_glutKeyboardFunc") (import GLUT_LIB "reg_glutMouseFunc") (import GLUT_LIB "reg_glutMotionFunc") (import GLUT_LIB "reg_glutPassiveMotionFunc") (import GLUT_LIB "reg_glutVisibilityFunc") (import GLUT_LIB "reg_glutEntryFunc") (import GLUT_LIB "reg_glutSpecialFunc") (import GLUT_LIB "reg_glutSpaceballMotionFunc") (import GLUT_LIB "reg_glutSpaceballRotateFunc") (import GLUT_LIB "reg_glutSpaceballButtonFunc") (import GLUT_LIB "reg_glutButtonBoxFunc") (import GLUT_LIB "reg_glutDialsFunc") (import GLUT_LIB "reg_glutTabletMotionFunc") (import GLUT_LIB "reg_glutTabletButtonFunc") (import GLUT_LIB "reg_glutMenuStatusFunc") (import GLUT_LIB "reg_glutMenuStateFunc") (import GLUT_LIB "reg_glutIdleFunc") (import GLUT_LIB "reg_glutTimerFunc") (import GLUT_LIB "reg_glutCreateMenu") (import GLUT_LIB "reg_glutDestroyMenu") (import GLUT_LIB "reg_glutMouseWheelFunc") (import GLUT_LIB "reg_glutJoystickFunc") (import GLUT_LIB "glutCallback") (import GLUT_LIB "glutCallbackGet") (import GLUT_LIB "glutCallbackValue") # MUI funcs (import GLUT_LIB "muiInit") (import GLUT_LIB "muiAttachUIList") (import GLUT_LIB "muiNewUIList") (import GLUT_LIB "muiAddToUIList") # (import GLUT_LIB "muiSetCallback") (import GLUT_LIB "muiGetObjectSize") (import GLUT_LIB "muiSetID") (import GLUT_LIB "muiGetID") # (import GLUT_LIB "muiSetNonMUIcallback") (import GLUT_LIB "muiGetVisible") (import GLUT_LIB "muiSetVisible") (import GLUT_LIB "muiGetActive") (import GLUT_LIB "muiSetActive") (import GLUT_LIB "muiGetEnable") (import GLUT_LIB "muiSetEnable") (import GLUT_LIB "muiSetActiveUIList") (import GLUT_LIB "muiGetActiveUIList") (import GLUT_LIB "muiNewButton") (import GLUT_LIB "muiLoadButton") (import GLUT_LIB "muiNewRadioButton") (import GLUT_LIB "muiNewTinyRadioButton") (import GLUT_LIB "muiLinkButtons") (import GLUT_LIB "muiClearRadio") (import GLUT_LIB "muiNewLabel") (import GLUT_LIB "muiNewBoldLabel") (import GLUT_LIB "muiChangeLabel") (import GLUT_LIB "muiNewTextbox") (import GLUT_LIB "muiGetTBString") (import GLUT_LIB "muiClearTBString") (import GLUT_LIB "muiSetTBString") (import GLUT_LIB "muiNewVSlider") (import GLUT_LIB "_muiGetVSVal") (import GLUT_LIB "muiSetVSValue") (import GLUT_LIB "muiSetVSArrowDelta") (import GLUT_LIB "muiNewHSlider") (import GLUT_LIB "_muiGetHSVal") (import GLUT_LIB "muiSetHSValue") (import GLUT_LIB "muiSetHSArrowDelta") (import GLUT_LIB "muiNewTextList") (import GLUT_LIB "muiSetTLTop") (import GLUT_LIB "muiGetTLSelectedItem") (import GLUT_LIB "muiSetTLStrings") (import GLUT_LIB "muiSetTLTopInt") (import GLUT_LIB "muiNewPulldown") (import GLUT_LIB "muiAddPulldownEntry") (import GLUT_LIB "reg_muiSetNonMUIcallback") (import GLUT_LIB "reg_muiSetCallback") (define (glutDisplayFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks display_counter) (string func_name)) (if (< display_counter 8) (inc display_counter)) (reg_glutDisplayFunc) ) (define (glutOverlayDisplayFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks overlaydisplay_counter) (string func_name)) (if (< overlaydisplay_counter 16) (inc overlaydisplay_counter)) (reg_glutOverlayDisplayFunc) ) (define (glutReshapeFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks reshape_counter) (string func_name)) (if (< reshape_counter 24) (inc reshape_counter)) (reg_glutReshapeFunc) ) (define (glutKeyboardFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks keyboard_counter) (string func_name)) (if (< keyboard_counter 32) (inc keyboard_counter)) (reg_glutKeyboardFunc) ) (define (glutMouseFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks mouse_counter) (string func_name)) (if (< mouse_counter 40) (inc mouse_counter)) (reg_glutMouseFunc) ) (define (glutMotionFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks motion_counter) (string func_name)) (if (< motion_counter 48) (inc motion_counter)) (reg_glutMotionFunc) ) (define (glutPassiveMotionFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks passivemotion_counter) (string func_name)) (if (< passivemotion_counter 56) (inc passivemotion_counter)) (reg_glutPassiveMotionFunc) ) (define (glutVisibilityFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks visibility_counter) (string func_name)) (if (< visibility_counter 64) (inc visibility_counter)) (reg_glutVisibilityFunc) ) (define (glutEntryFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks entry_counter) (string func_name)) (if (< entry_counter 72) (inc entry_counter)) (reg_glutEntryFunc) ) (define (glutSpecialFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks special_counter) (string func_name)) (if (< special_counter 80) (inc special_counter)) (reg_glutSpecialFunc) ) (define (glutSpaceballMotionFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks spaceballmotion_counter) (string func_name)) (if (< spaceballmotion_counter 88) (inc spaceballmotion_counter)) (reg_glutSpaceballMotionFunc) ) (define (glutSpaceballRotateFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks spaceballrotate_counter) (string func_name)) (if (< spaceballrotate_counter 96) (inc spaceballrotate_counter)) (reg_glutSpaceballRotateFunc) ) (define (glutSpaceballButtonFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks spaceballbutton_counter) (string func_name)) (if (< spaceballbutton_counter 104) (inc spaceballbutton_counter)) (glutSpaceballButtonFunc) ) (define (glutButtonBoxFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks buttonbox_counter) (string func_name)) (if (< buttonbox_counter 112) (inc buttonbox_counter)) (reg_glutButtonBoxFunc) ) (define (glutDialsFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks dials_counter) (string func_name)) (if (< dials_counter 120) (inc dials_counter)) (reg_glutDialsFunc) ) (define (glutTabletMotionFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks tabletmotion_counter) (string func_name)) (if (< tabletmotion_counter 128) (inc tabletmotion_counter)) (reg_glutTabletMotionFunc) ) (define (glutTabletButtonFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks tabletbutton_counter) (string func_name)) (if (< tabletbutton_counter 136) (inc tabletbutton_counter)) (reg_glutTabletButtonFunc) ) (define (glutTimerFunc secs func_name value) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks timer_counter) (string func_name)) (if (< timer_counter 144) (inc timer_counter)) (reg_glutTimerFunc secs value) ) (define (glutCreateMenu func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks menu_counter) (string func_name)) (if (< menu_counter 152) (inc menu_counter)) (reg_glutCreateMenu) ) (define (glutDestroyMenu menu) (dec menu_counter) (reg_glutDestroyMenu) ) (define (glutMenuStatusFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks 152) (string func_name)) (reg_glutMenuStatusFunc) ) (define (glutMenuStateFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks 153) (string func_name)) (reg_glutMenuStateFunc) ) (define (glutIdleFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks 154) (string func_name)) (reg_glutIdleFunc) ) (define (muiSetNonMUIcallback func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks 155) (string func_name)) (reg_muiSetNonMUIcallback) ) (define (muiSetCallback muiObject func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks mui_counter) (string func_name)) (if (< mui_counter (+ 156 32)) (inc mui_counter)) (reg_muiSetCallback muiObject) ) (define (glutMouseWheelFunc func_name) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks mousewheel_counter) (string func_name)) (if (< mousewheel_counter 196) (inc mousewheel_counter)) (reg_glutMouseWheelFunc)) (define (glutJoystickFunc func_name poll) (if (= (find ":" (string func_name)) nil) (set 'func_name (append "MAIN:" (string func_name)))) (setf (callbacks joystick_counter) (string func_name)) (if (< joystick_counter 204) (inc joystick_counter)) (reg_glutJoystickFunc poll)) # There seems to be an issue with returning floats, hence this workaround (define (muiGetVSVal obj) (flt (div (_muiGetVSVal obj) 1000000))) # There seems to be an issue with returning floats, hence this workaround (define (muiGetHSVal obj) (flt (div (_muiGetHSVal obj) 1000000))) (define (glutMainLoop) # Run forever (while true # Run through signals in chronological order (set 'act_sig 1) (set 'tot_sig (glutCallback delay)) # Limit is total amount of occured signals (while (<= act_sig tot_sig) (set 'func (nth (glutCallbackGet act_sig) callbacks)) (set 'arg1 (glutCallbackValue 1 act_sig)) (set 'arg2 (glutCallbackValue 2 act_sig)) (set 'arg3 (glutCallbackValue 3 act_sig)) (set 'arg4 (glutCallbackValue 4 act_sig)) (if (!= func "MAIN:NULL") (eval-string (append "(" (string func) " " (string arg1) " " (string arg2) " " (string arg3) " " (string arg4) ")") )) (inc act_sig) ) ) ) (context 'MAIN) #----------------------------------------------FreeGLUT specials # (import GLUT_LIB "glutMouseWheelFunc") ---> implemented # (import GLUT_LIB "glutJoystickFunc") ---> implemented # (import GLUT_LIB "glutForceJoystickFunc") # (import GLUT_LIB "glutCloseFunc") # (import GLUT_LIB "glutWMCloseFunc") # (import GLUT_LIB "glutKeyboardUpFunc") # (import GLUT_LIB "glutSpecialUpFunc") # (import GLUT_LIB "glutMenuDestroyFunc") # (import GLUT_LIB "glutWindowStatusFunc") #----------------------------------------------FreeGLUT specials