Note: This is taken from the Chicken Wiki, where a more recent version could be available.
Bindings for the GLUT API.
<constant>glut:RGB</constant> <constant>glut:RGBA</constant> <constant>glut:INDEX</constant> <constant>glut:SINGLE</constant> <constant>glut:DOUBLE</constant> <constant>glut:ACCUM</constant> <constant>glut:ALPHA</constant> <constant>glut:DEPTH</constant> <constant>glut:STENCIL</constant> <constant>glut:MULTISAMPLE</constant> <constant>glut:STEREO</constant> <constant>glut:LUMINANCE</constant> <constant>glut:LEFT_BUTTON</constant> <constant>glut:MIDDLE_BUTTON</constant> <constant>glut:RIGHT_BUTTON</constant> <constant>glut:DOWN</constant> <constant>glut:UP</constant> <constant>glut:KEY_F1</constant> <constant>glut:KEY_F2</constant> <constant>glut:KEY_F3</constant> <constant>glut:KEY_F4</constant> <constant>glut:KEY_F5</constant> <constant>glut:KEY_F6</constant> <constant>glut:KEY_F7</constant> <constant>glut:KEY_F8</constant> <constant>glut:KEY_F9</constant> <constant>glut:KEY_F10</constant> <constant>glut:KEY_F11</constant> <constant>glut:KEY_F12</constant> <constant>glut:KEY_LEFT</constant> <constant>glut:KEY_UP</constant> <constant>glut:KEY_RIGHT</constant> <constant>glut:KEY_DOWN</constant> <constant>glut:KEY_PAGE_UP</constant> <constant>glut:KEY_PAGE_DOWN</constant> <constant>glut:KEY_HOME</constant> <constant>glut:KEY_END</constant> <constant>glut:KEY_INSERT</constant> <constant>glut:LEFT</constant> <constant>glut:ENTERED</constant> <constant>glut:MENU_NOT_IN_USE</constant> <constant>glut:MENU_IN_USE</constant> <constant>glut:NOT_VISIBLE</constant> <constant>glut:VISIBLE</constant> <constant>glut:HIDDEN</constant> <constant>glut:FULLY_RETAINED</constant> <constant>glut:PARTIALLY_RETAINED</constant> <constant>glut:FULLY_COVERED</constant> <constant>glut:RED</constant> <constant>glut:GREEN</constant> <constant>glut:BLUE</constant> <constant>glut:NORMAL</constant> <constant>glut:OVERLAY</constant> <constant>glut:WINDOW_X</constant> <constant>glut:WINDOW_Y</constant> <constant>glut:WINDOW_WIDTH</constant> <constant>glut:WINDOW_HEIGHT</constant> <constant>glut:WINDOW_BUFFER_SIZE</constant> <constant>glut:WINDOW_STENCIL_SIZE</constant> <constant>glut:WINDOW_DEPTH_SIZE</constant> <constant>glut:WINDOW_RED_SIZE</constant> <constant>glut:WINDOW_GREEN_SIZE</constant> <constant>glut:WINDOW_BLUE_SIZE</constant> <constant>glut:WINDOW_ALPHA_SIZE</constant> <constant>glut:WINDOW_ACCUM_RED_SIZE</constant> <constant>glut:WINDOW_ACCUM_GREEN_SIZE</constant> <constant>glut:WINDOW_ACCUM_BLUE_SIZE</constant> <constant>glut:WINDOW_ACCUM_ALPHA_SIZE</constant> <constant>glut:WINDOW_DOUBLEBUFFER</constant> <constant>glut:WINDOW_RGBA</constant> <constant>glut:WINDOW_PARENT</constant> <constant>glut:WINDOW_NUM_CHILDREN</constant> <constant>glut:WINDOW_COLORMAP_SIZE</constant> <constant>glut:WINDOW_NUM_SAMPLES</constant> <constant>glut:WINDOW_STEREO</constant> <constant>glut:WINDOW_CURSOR</constant> <constant>glut:SCREEN_WIDTH</constant> <constant>glut:SCREEN_HEIGHT</constant> <constant>glut:SCREEN_WIDTH_MM</constant> <constant>glut:SCREEN_HEIGHT_MM</constant> <constant>glut:MENU_NUM_ITEMS</constant> <constant>glut:DISPLAY_MODE_POSSIBLE</constant> <constant>glut:INIT_WINDOW_X</constant> <constant>glut:INIT_WINDOW_Y</constant> <constant>glut:INIT_WINDOW_WIDTH</constant> <constant>glut:INIT_WINDOW_HEIGHT</constant> <constant>glut:INIT_DISPLAY_MODE</constant> <constant>glut:ELAPSED_TIME</constant> <constant>glut:WINDOW_FORMAT_ID</constant> <constant>glut:HAS_KEYBOARD</constant> <constant>glut:HAS_MOUSE</constant> <constant>glut:HAS_SPACEBALL</constant> <constant>glut:HAS_DIAL_AND_BUTTON_BOX</constant> <constant>glut:HAS_TABLET</constant> <constant>glut:NUM_MOUSE_BUTTONS</constant> <constant>glut:NUM_SPACEBALL_BUTTONS</constant> <constant>glut:NUM_BUTTON_BOX_BUTTONS</constant> <constant>glut:NUM_DIALS</constant> <constant>glut:NUM_TABLET_BUTTONS</constant> <constant>glut:DEVICE_IGNORE_KEY_REPEAT</constant> <constant>glut:DEVICE_KEY_REPEAT</constant> <constant>glut:HAS_JOYSTICK</constant> <constant>glut:OWNS_JOYSTICK</constant> <constant>glut:JOYSTICK_BUTTONS</constant> <constant>glut:JOYSTICK_AXES</constant> <constant>glut:JOYSTICK_POLL_RATE</constant> <constant>glut:OVERLAY_POSSIBLE</constant> <constant>glut:LAYER_IN_USE</constant> <constant>glut:HAS_OVERLAY</constant> <constant>glut:TRANSPARENT_INDEX</constant> <constant>glut:NORMAL_DAMAGED</constant> <constant>glut:OVERLAY_DAMAGED</constant> <constant>glut:VIDEO_RESIZE_POSSIBLE</constant> <constant>glut:VIDEO_RESIZE_IN_USE</constant> <constant>glut:VIDEO_RESIZE_X_DELTA</constant> <constant>glut:VIDEO_RESIZE_Y_DELTA</constant> <constant>glut:VIDEO_RESIZE_WIDTH_DELTA</constant> <constant>glut:VIDEO_RESIZE_HEIGHT_DELTA</constant> <constant>glut:VIDEO_RESIZE_X</constant> <constant>glut:VIDEO_RESIZE_Y</constant> <constant>glut:VIDEO_RESIZE_WIDTH</constant> <constant>glut:VIDEO_RESIZE_HEIGHT</constant> <constant>glut:NORMAL</constant> <constant>glut:OVERLAY</constant> <constant>glut:ACTIVE_SHIFT</constant> <constant>glut:ACTIVE_CTRL</constant> <constant>glut:ACTIVE_ALT</constant> <constant>glut:CURSOR_RIGHT_ARROW</constant> <constant>glut:CURSOR_LEFT_ARROW</constant> <constant>glut:CURSOR_INFO</constant> <constant>glut:CURSOR_DESTROY</constant> <constant>glut:CURSOR_HELP</constant> <constant>glut:CURSOR_CYCLE</constant> <constant>glut:CURSOR_SPRAY</constant> <constant>glut:CURSOR_WAIT</constant> <constant>glut:CURSOR_TEXT</constant> <constant>glut:CURSOR_CROSSHAIR</constant> <constant>glut:CURSOR_UP_DOWN</constant> <constant>glut:CURSOR_LEFT_RIGHT</constant> <constant>glut:CURSOR_TOP_SIDE</constant> <constant>glut:CURSOR_BOTTOM_SIDE</constant> <constant>glut:CURSOR_LEFT_SIDE</constant> <constant>glut:CURSOR_RIGHT_SIDE</constant> <constant>glut:CURSOR_TOP_LEFT_CORNER</constant> <constant>glut:CURSOR_TOP_RIGHT_CORNER</constant> <constant>glut:CURSOR_BOTTOM_RIGHT_CORNER</constant> <constant>glut:CURSOR_BOTTOM_LEFT_CORNER</constant> <constant>glut:CURSOR_INHERIT</constant> <constant>glut:CURSOR_NONE</constant> <constant>glut:CURSOR_FULL_CROSSHAIR</constant> <constant>glut:STROKE_ROMAN</constant> <constant>glut:STROKE_MONO_ROMAN</constant> <constant>glut:BITMAP_9_BY_15</constant> <constant>glut:BITMAP_8_BY_13</constant> <constant>glut:BITMAP_TIMES_ROMAN_10</constant> <constant>glut:BITMAP_TIMES_ROMAN_24</constant> <constant>glut:BITMAP_HELVETICA_10</constant> <constant>glut:BITMAP_HELVETICA_12</constant> <constant>glut:BITMAP_HELVETICA_18</constant> <constant>glut:KEY_REPEAT_OFF</constant> <constant>glut:KEY_REPEAT_ON</constant> <constant>glut:KEY_REPEAT_DEFAULT</constant> <constant>glut:JOYSTICK_BUTTON_A</constant> <constant>glut:JOYSTICK_BUTTON_B</constant> <constant>glut:JOYSTICK_BUTTON_C</constant> <constant>glut:JOYSTICK_BUTTON_D</constant> <constant>glut:GAME_MODE_ACTIVE</constant> <constant>glut:GAME_MODE_POSSIBLE</constant> <constant>glut:GAME_MODE_WIDTH</constant> <constant>glut:GAME_MODE_HEIGHT</constant> <constant>glut:GAME_MODE_PIXEL_DEPTH</constant> <constant>glut:GAME_MODE_REFRESH_RATE</constant> <constant>glut:GAME_MODE_DISPLAY_CHANGED</constant> <procedure>(glut:InitDisplayMode UNSIGNED-INTEGER)</procedure> <procedure>(glut:InitDisplayString STRING)</procedure> <procedure>(glut:InitWindowPosition INTEGER INTEGER)</procedure> <procedure>(glut:InitWindowSize INTEGER INTEGER)</procedure> <procedure>(glut:MainLoop)</procedure> <procedure>(glut:CreateWindow C-STRING) → INTEGER</procedure> <procedure>(glut:CreateSubWindow INTEGER INTEGER INTEGER INTEGER INTEGER) → INTEGER</procedure> <procedure>(glut:DestroyWindow INTEGER)</procedure> <procedure>(glut:PostRedisplay)</procedure> <procedure>(glut:PostWindowRedisplay INTEGER)</procedure> <procedure>(glut:PostWindowOverlayRedisplay INTEGER)</procedure> <procedure>(glut:SwapBuffers)</procedure> <procedure>(glut:GetWindow) → INTEGER</procedure> <procedure>(glut:SetWindow INTEGER)</procedure> <procedure>(glut:SetWindowTitle C-STRING)</procedure> <procedure>(glut:SetIconTitle C-STRING)</procedure> <procedure>(glut:PositionWindow INTEGER INTEGER)</procedure> <procedure>(glut:ReshapeWindow INTEGER INTEGER)</procedure> <procedure>(glut:PopWindow)</procedure> <procedure>(glut:PushWindow)</procedure> <procedure>(glut:IconifyWindow)</procedure> <procedure>(glut:ShowWindow)</procedure> <procedure>(glut:HideWindow)</procedure> <procedure>(glut:CreateMenu PROCEDURE) → INTEGER</procedure> <procedure>(glut:DestroyMenu INTEGER)</procedure> <procedure>(glut:GetMenu) → INTEGER</procedure> <procedure>(glut:SetMenu INTEGER)</procedure> <procedure>(glut:AddMenuEntry C-STRING INTEGER)</procedure> <procedure>(glut:AddSubMenu C-STRING INTEGER)</procedure> <procedure>(glut:ChangeToMenuEntry INTEGER C-STRING INTEGER)</procedure> <procedure>(glut:ChangeToSubMenu INTEGER C-STRING INTEGER)</procedure> <procedure>(glut:RemoveMenuItem INTEGER)</procedure> <procedure>(glut:AttachMenu INTEGER)</procedure> <procedure>(glut:DetachMenu INTEGER)</procedure> <procedure>(glut:DisplayFunc PROCEDURE)</procedure> <procedure>(glut:ReshapeFunc PROCEDURE)</procedure> <procedure>(glut:KeyboardFunc PROCEDURE)</procedure> <procedure>(glut:MouseFunc PROCEDURE)</procedure> <procedure>(glut:MotionFunc PROCEDURE)</procedure> <procedure>(glut:PassiveMotionFunc PROCEDURE)</procedure> <procedure>(glut:EntryFunc PROCEDURE)</procedure> <procedure>(glut:VisibilityFunc PROCEDURE)</procedure> <procedure>(glut:IdleFunc PROCEDURE)</procedure> <procedure>(glut:TimerFunc UNSIGNED-INTEGER PROCEDURE INTEGER)</procedure> <procedure>(glut:MenuStateFunc PROCEDURE)</procedure> <procedure>(glut:WindowStatusFunc PROCEDURE)</procedure> <procedure>(glut:KeyboardUpFunc PROCEDURE)</procedure> <procedure>(glut:SpecialUpFunc PROCEDURE)</procedure> <procedure>(glut:JoystickFunc PROCEDURE)</procedure> <procedure>(glut:SetColor INTEGER FLOAT FLOAT FLOAT)</procedure> <procedure>(glut:GetColor INTEGER INTEGER) → FLOAT</procedure> <procedure>(glut:CopyColormap INTEGER)</procedure> <procedure>(glut:Get INTEGER) → INTEGER</procedure> <procedure>(glut:DeviceGet INTEGER) → INTEGER</procedure> <procedure>(glut:BitmapCharacter (POINTER VOID) CHAR)</procedure> <procedure>(glut:BitmapWidth (POINTER VOID) CHAR) → INTEGER</procedure> <procedure>(glut:StrokeCharacter (POINTER VOID) CHAR)</procedure> <procedure>(glut:StrokeWidth (POINTER VOID) CHAR) → INTEGER</procedure> <procedure>(glut:WireSphere DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:SolidSphere DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:WireCone DOUBLE DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:SolidCone DOUBLE DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:WireCube DOUBLE)</procedure> <procedure>(glut:SolidCube DOUBLE)</procedure> <procedure>(glut:WireTorus DOUBLE DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:SolidTorus DOUBLE DOUBLE INTEGER INTEGER)</procedure> <procedure>(glut:WireDodecahedron)</procedure> <procedure>(glut:SolidDodecahedron)</procedure> <procedure>(glut:WireTeapot DOUBLE)</procedure> <procedure>(glut:SolidTeapot DOUBLE)</procedure> <procedure>(glut:WireOctahedron)</procedure> <procedure>(glut:SolidOctahedron)</procedure> <procedure>(glut:WireTetrahedron)</procedure> <procedure>(glut:SolidTetrahedron)</procedure> <procedure>(glut:WireIcosahedron)</procedure> <procedure>(glut:SolidIcosahedron)</procedure> <procedure>(glut:WarpPointer INTEGER INTEGER)</procedure> <procedure>(glut:VideoResizeGet INTEGER)</procedure> <procedure>(glut:SetupVideoResizing)</procedure> <procedure>(glut:StopVideoResizing)</procedure> <procedure>(glut:VideoResize INTEGER INTEGER INTEGER INTEGER)</procedure> <procedure>(glut:VideoPan INTEGER INTEGER INTEGER INTEGER)</procedure> <procedure>(glut:ReportErrors)</procedure> <procedure>(glut:IgnoreKeyRepeat BOOLEAN)</procedure> <procedure>(glut:SetKeyRepeat INTEGER)</procedure> <procedure>(glut:ForceJoystickFunc)</procedure> <procedure>(glut:GameModeString STRING)</procedure> <procedure>(glut:EnterGameMode)</procedure> <procedure>(glut:LeaveGameMode)</procedure> <procedure>(glut:GameModeGet INTEGER)</procedure>
Constants and procedures for the OpenGL GLUT API. Note that glutInit will be called automatically after the (opengl glut) extension is loaded.
A most trivial example: a white rectangle
<example> <init>(require-extension gl glut)</init> <expr> (glut:CreateWindow "simple")
(glut:DisplayFunc
(lambda () (gl:Clear gl:COLOR_BUFFER_BIT) (gl:Begin gl:POLYGON) (gl:Vertex2f -0.5 -0.5) (gl:Vertex2f -0.5 0.5) (gl:Vertex2f 0.5 0.5) (gl:Vertex2f 0.5 -0.5) (gl:End) (gl:Flush) ) )
(gl:ClearColor 0 0 0 1) (glut:MainLoop) </expr> </example>
The well-known "gears" example can be found in the gears.scm file in the egg distribution.
Copyright (c) 2004-2006, Felix L. Winkelmann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.