source: project/wiki/eggref/3/glut @ 32241

Last change on this file since 32241 was 32241, checked in by felix winkelmann, 6 years ago

removed some call/cc.org links

File size: 14.2 KB
Line 
1 [[tags: egg]]
2
3== glut
4
5[[toc:]]
6
7=== Description
8
9Bindings for the GLUT API.
10
11=== Author
12
13[[/users/felix winkelmann|felix winkelmann]]
14
15=== Requirements
16
17* [[silex]]
18* [[easyffi]]
19
20=== Documentation
21
22<constant>glut:RGB</constant>
23<constant>glut:RGBA</constant>
24<constant>glut:INDEX</constant>
25<constant>glut:SINGLE</constant>
26<constant>glut:DOUBLE</constant>
27<constant>glut:ACCUM</constant>
28<constant>glut:ALPHA</constant>
29<constant>glut:DEPTH</constant>
30<constant>glut:STENCIL</constant>
31<constant>glut:MULTISAMPLE</constant>
32<constant>glut:STEREO</constant>
33<constant>glut:LUMINANCE</constant>
34<constant>glut:LEFT_BUTTON</constant>
35<constant>glut:MIDDLE_BUTTON</constant>
36<constant>glut:RIGHT_BUTTON</constant>
37<constant>glut:DOWN</constant>
38<constant>glut:UP</constant>
39<constant>glut:KEY_F1</constant>
40<constant>glut:KEY_F2</constant>
41<constant>glut:KEY_F3</constant>
42<constant>glut:KEY_F4</constant>
43<constant>glut:KEY_F5</constant>
44<constant>glut:KEY_F6</constant>
45<constant>glut:KEY_F7</constant>
46<constant>glut:KEY_F8</constant>
47<constant>glut:KEY_F9</constant>
48<constant>glut:KEY_F10</constant>
49<constant>glut:KEY_F11</constant>
50<constant>glut:KEY_F12</constant>
51<constant>glut:KEY_LEFT</constant>
52<constant>glut:KEY_UP</constant>
53<constant>glut:KEY_RIGHT</constant>
54<constant>glut:KEY_DOWN</constant>
55<constant>glut:KEY_PAGE_UP</constant>
56<constant>glut:KEY_PAGE_DOWN</constant>
57<constant>glut:KEY_HOME</constant>
58<constant>glut:KEY_END</constant>
59<constant>glut:KEY_INSERT</constant>
60<constant>glut:LEFT</constant>
61<constant>glut:ENTERED</constant>
62<constant>glut:MENU_NOT_IN_USE</constant>
63<constant>glut:MENU_IN_USE</constant>
64<constant>glut:NOT_VISIBLE</constant>
65<constant>glut:VISIBLE</constant>
66<constant>glut:HIDDEN</constant>
67<constant>glut:FULLY_RETAINED</constant>
68<constant>glut:PARTIALLY_RETAINED</constant>
69<constant>glut:FULLY_COVERED</constant>
70<constant>glut:RED</constant>
71<constant>glut:GREEN</constant>
72<constant>glut:BLUE</constant>
73<constant>glut:NORMAL</constant>
74<constant>glut:OVERLAY</constant>
75<constant>glut:WINDOW_X</constant>
76<constant>glut:WINDOW_Y</constant>
77<constant>glut:WINDOW_WIDTH</constant>
78<constant>glut:WINDOW_HEIGHT</constant>
79<constant>glut:WINDOW_BUFFER_SIZE</constant>
80<constant>glut:WINDOW_STENCIL_SIZE</constant>
81<constant>glut:WINDOW_DEPTH_SIZE</constant>
82<constant>glut:WINDOW_RED_SIZE</constant>
83<constant>glut:WINDOW_GREEN_SIZE</constant>
84<constant>glut:WINDOW_BLUE_SIZE</constant>
85<constant>glut:WINDOW_ALPHA_SIZE</constant>
86<constant>glut:WINDOW_ACCUM_RED_SIZE</constant>
87<constant>glut:WINDOW_ACCUM_GREEN_SIZE</constant>
88<constant>glut:WINDOW_ACCUM_BLUE_SIZE</constant>
89<constant>glut:WINDOW_ACCUM_ALPHA_SIZE</constant>
90<constant>glut:WINDOW_DOUBLEBUFFER</constant>
91<constant>glut:WINDOW_RGBA</constant>
92<constant>glut:WINDOW_PARENT</constant>
93<constant>glut:WINDOW_NUM_CHILDREN</constant>
94<constant>glut:WINDOW_COLORMAP_SIZE</constant>
95<constant>glut:WINDOW_NUM_SAMPLES</constant>
96<constant>glut:WINDOW_STEREO</constant>
97<constant>glut:WINDOW_CURSOR</constant>
98<constant>glut:SCREEN_WIDTH</constant>
99<constant>glut:SCREEN_HEIGHT</constant>
100<constant>glut:SCREEN_WIDTH_MM</constant>
101<constant>glut:SCREEN_HEIGHT_MM</constant>
102<constant>glut:MENU_NUM_ITEMS</constant>
103<constant>glut:DISPLAY_MODE_POSSIBLE</constant>
104<constant>glut:INIT_WINDOW_X</constant>
105<constant>glut:INIT_WINDOW_Y</constant>
106<constant>glut:INIT_WINDOW_WIDTH</constant>
107<constant>glut:INIT_WINDOW_HEIGHT</constant>
108<constant>glut:INIT_DISPLAY_MODE</constant>
109<constant>glut:ELAPSED_TIME</constant>
110<constant>glut:WINDOW_FORMAT_ID</constant>
111<constant>glut:HAS_KEYBOARD</constant>
112<constant>glut:HAS_MOUSE</constant>
113<constant>glut:HAS_SPACEBALL</constant>
114<constant>glut:HAS_DIAL_AND_BUTTON_BOX</constant>
115<constant>glut:HAS_TABLET</constant>
116<constant>glut:NUM_MOUSE_BUTTONS</constant>
117<constant>glut:NUM_SPACEBALL_BUTTONS</constant>
118<constant>glut:NUM_BUTTON_BOX_BUTTONS</constant>
119<constant>glut:NUM_DIALS</constant>
120<constant>glut:NUM_TABLET_BUTTONS</constant>
121<constant>glut:DEVICE_IGNORE_KEY_REPEAT</constant>
122<constant>glut:DEVICE_KEY_REPEAT</constant>
123<constant>glut:HAS_JOYSTICK</constant>
124<constant>glut:OWNS_JOYSTICK</constant>
125<constant>glut:JOYSTICK_BUTTONS</constant>
126<constant>glut:JOYSTICK_AXES</constant>
127<constant>glut:JOYSTICK_POLL_RATE</constant>
128<constant>glut:OVERLAY_POSSIBLE</constant>
129<constant>glut:LAYER_IN_USE</constant>
130<constant>glut:HAS_OVERLAY</constant>
131<constant>glut:TRANSPARENT_INDEX</constant>
132<constant>glut:NORMAL_DAMAGED</constant>
133<constant>glut:OVERLAY_DAMAGED</constant>
134<constant>glut:VIDEO_RESIZE_POSSIBLE</constant>
135<constant>glut:VIDEO_RESIZE_IN_USE</constant>
136<constant>glut:VIDEO_RESIZE_X_DELTA</constant>
137<constant>glut:VIDEO_RESIZE_Y_DELTA</constant>
138<constant>glut:VIDEO_RESIZE_WIDTH_DELTA</constant>
139<constant>glut:VIDEO_RESIZE_HEIGHT_DELTA</constant>
140<constant>glut:VIDEO_RESIZE_X</constant>
141<constant>glut:VIDEO_RESIZE_Y</constant>
142<constant>glut:VIDEO_RESIZE_WIDTH</constant>
143<constant>glut:VIDEO_RESIZE_HEIGHT</constant>
144<constant>glut:NORMAL</constant>
145<constant>glut:OVERLAY</constant>
146<constant>glut:ACTIVE_SHIFT</constant>
147<constant>glut:ACTIVE_CTRL</constant>
148<constant>glut:ACTIVE_ALT</constant>
149<constant>glut:CURSOR_RIGHT_ARROW</constant>
150<constant>glut:CURSOR_LEFT_ARROW</constant>
151<constant>glut:CURSOR_INFO</constant>
152<constant>glut:CURSOR_DESTROY</constant>
153<constant>glut:CURSOR_HELP</constant>
154<constant>glut:CURSOR_CYCLE</constant>
155<constant>glut:CURSOR_SPRAY</constant>
156<constant>glut:CURSOR_WAIT</constant>
157<constant>glut:CURSOR_TEXT</constant>
158<constant>glut:CURSOR_CROSSHAIR</constant>
159<constant>glut:CURSOR_UP_DOWN</constant>
160<constant>glut:CURSOR_LEFT_RIGHT</constant>
161<constant>glut:CURSOR_TOP_SIDE</constant>
162<constant>glut:CURSOR_BOTTOM_SIDE</constant>
163<constant>glut:CURSOR_LEFT_SIDE</constant>
164<constant>glut:CURSOR_RIGHT_SIDE</constant>
165<constant>glut:CURSOR_TOP_LEFT_CORNER</constant>
166<constant>glut:CURSOR_TOP_RIGHT_CORNER</constant>
167<constant>glut:CURSOR_BOTTOM_RIGHT_CORNER</constant>
168<constant>glut:CURSOR_BOTTOM_LEFT_CORNER</constant>
169<constant>glut:CURSOR_INHERIT</constant>
170<constant>glut:CURSOR_NONE</constant>
171<constant>glut:CURSOR_FULL_CROSSHAIR</constant>
172<constant>glut:STROKE_ROMAN</constant>
173<constant>glut:STROKE_MONO_ROMAN</constant>
174<constant>glut:BITMAP_9_BY_15</constant>
175<constant>glut:BITMAP_8_BY_13</constant>
176<constant>glut:BITMAP_TIMES_ROMAN_10</constant>
177<constant>glut:BITMAP_TIMES_ROMAN_24</constant>
178<constant>glut:BITMAP_HELVETICA_10</constant>
179<constant>glut:BITMAP_HELVETICA_12</constant>
180<constant>glut:BITMAP_HELVETICA_18</constant>
181<constant>glut:KEY_REPEAT_OFF</constant>
182<constant>glut:KEY_REPEAT_ON</constant>
183<constant>glut:KEY_REPEAT_DEFAULT</constant>
184<constant>glut:JOYSTICK_BUTTON_A</constant>
185<constant>glut:JOYSTICK_BUTTON_B</constant>
186<constant>glut:JOYSTICK_BUTTON_C</constant>
187<constant>glut:JOYSTICK_BUTTON_D</constant>
188<constant>glut:GAME_MODE_ACTIVE</constant>
189<constant>glut:GAME_MODE_POSSIBLE</constant>
190<constant>glut:GAME_MODE_WIDTH</constant>
191<constant>glut:GAME_MODE_HEIGHT</constant>
192<constant>glut:GAME_MODE_PIXEL_DEPTH</constant>
193<constant>glut:GAME_MODE_REFRESH_RATE</constant>
194<constant>glut:GAME_MODE_DISPLAY_CHANGED</constant>
195<procedure>(glut:InitDisplayMode UNSIGNED-INTEGER)</procedure>
196<procedure>(glut:InitDisplayString STRING)</procedure>
197<procedure>(glut:InitWindowPosition INTEGER INTEGER)</procedure>
198<procedure>(glut:InitWindowSize INTEGER INTEGER)</procedure>
199<procedure>(glut:MainLoop)</procedure>
200<procedure>(glut:CreateWindow C-STRING) -> INTEGER</procedure>
201<procedure>(glut:CreateSubWindow INTEGER INTEGER INTEGER INTEGER INTEGER) -> INTEGER</procedure>
202<procedure>(glut:DestroyWindow INTEGER)</procedure>
203<procedure>(glut:PostRedisplay)</procedure>
204<procedure>(glut:PostWindowRedisplay INTEGER)</procedure>
205<procedure>(glut:PostWindowOverlayRedisplay INTEGER)</procedure>
206<procedure>(glut:SwapBuffers)</procedure>
207<procedure>(glut:GetWindow) -> INTEGER</procedure>
208<procedure>(glut:SetWindow INTEGER)</procedure>
209<procedure>(glut:SetWindowTitle C-STRING)</procedure>
210<procedure>(glut:SetIconTitle C-STRING)</procedure>
211<procedure>(glut:PositionWindow INTEGER INTEGER)</procedure>
212<procedure>(glut:ReshapeWindow INTEGER INTEGER)</procedure>
213<procedure>(glut:PopWindow)</procedure>
214<procedure>(glut:PushWindow)</procedure>
215<procedure>(glut:IconifyWindow)</procedure>
216<procedure>(glut:ShowWindow)</procedure>
217<procedure>(glut:HideWindow)</procedure>
218<procedure>(glut:CreateMenu PROCEDURE) -> INTEGER</procedure>
219<procedure>(glut:DestroyMenu INTEGER)</procedure>
220<procedure>(glut:GetMenu) -> INTEGER</procedure>
221<procedure>(glut:SetMenu INTEGER)</procedure>
222<procedure>(glut:AddMenuEntry C-STRING INTEGER)</procedure>
223<procedure>(glut:AddSubMenu C-STRING INTEGER)</procedure>
224<procedure>(glut:ChangeToMenuEntry INTEGER C-STRING INTEGER)</procedure>
225<procedure>(glut:ChangeToSubMenu INTEGER C-STRING INTEGER)</procedure>
226<procedure>(glut:RemoveMenuItem INTEGER)</procedure>
227<procedure>(glut:AttachMenu INTEGER)</procedure>
228<procedure>(glut:DetachMenu INTEGER)</procedure>
229<procedure>(glut:DisplayFunc PROCEDURE)</procedure>
230<procedure>(glut:ReshapeFunc PROCEDURE)</procedure>
231<procedure>(glut:KeyboardFunc PROCEDURE)</procedure>
232<procedure>(glut:MouseFunc PROCEDURE)</procedure>
233<procedure>(glut:MotionFunc PROCEDURE)</procedure>
234<procedure>(glut:PassiveMotionFunc PROCEDURE)</procedure>
235<procedure>(glut:EntryFunc PROCEDURE)</procedure>
236<procedure>(glut:VisibilityFunc PROCEDURE)</procedure>
237<procedure>(glut:IdleFunc PROCEDURE)</procedure>
238<procedure>(glut:TimerFunc UNSIGNED-INTEGER PROCEDURE INTEGER)</procedure>
239<procedure>(glut:MenuStateFunc PROCEDURE)</procedure>
240<procedure>(glut:WindowStatusFunc PROCEDURE)</procedure>
241<procedure>(glut:KeyboardUpFunc PROCEDURE)</procedure>
242<procedure>(glut:SpecialUpFunc PROCEDURE)</procedure>
243<procedure>(glut:JoystickFunc PROCEDURE)</procedure>
244<procedure>(glut:SetColor INTEGER FLOAT FLOAT FLOAT)</procedure>
245<procedure>(glut:GetColor INTEGER INTEGER) -> FLOAT</procedure>
246<procedure>(glut:CopyColormap INTEGER)</procedure>
247<procedure>(glut:Get INTEGER) -> INTEGER</procedure>
248<procedure>(glut:DeviceGet INTEGER) -> INTEGER</procedure>
249<procedure>(glut:BitmapCharacter (POINTER VOID) CHAR)</procedure>
250<procedure>(glut:BitmapWidth (POINTER VOID) CHAR) -> INTEGER</procedure>
251<procedure>(glut:StrokeCharacter (POINTER VOID) CHAR)</procedure>
252<procedure>(glut:StrokeWidth (POINTER VOID) CHAR) -> INTEGER</procedure>
253<procedure>(glut:WireSphere DOUBLE INTEGER INTEGER)</procedure>
254<procedure>(glut:SolidSphere DOUBLE INTEGER INTEGER)</procedure>
255<procedure>(glut:WireCone DOUBLE DOUBLE INTEGER INTEGER)</procedure>
256<procedure>(glut:SolidCone DOUBLE DOUBLE INTEGER INTEGER)</procedure>
257<procedure>(glut:WireCube DOUBLE)</procedure>
258<procedure>(glut:SolidCube DOUBLE)</procedure>
259<procedure>(glut:WireTorus DOUBLE DOUBLE INTEGER INTEGER)</procedure>
260<procedure>(glut:SolidTorus DOUBLE DOUBLE INTEGER INTEGER)</procedure>
261<procedure>(glut:WireDodecahedron)</procedure>
262<procedure>(glut:SolidDodecahedron)</procedure>
263<procedure>(glut:WireTeapot DOUBLE)</procedure>
264<procedure>(glut:SolidTeapot DOUBLE)</procedure>
265<procedure>(glut:WireOctahedron)</procedure>
266<procedure>(glut:SolidOctahedron)</procedure>
267<procedure>(glut:WireTetrahedron)</procedure>
268<procedure>(glut:SolidTetrahedron)</procedure>
269<procedure>(glut:WireIcosahedron)</procedure>
270<procedure>(glut:SolidIcosahedron)</procedure>
271<procedure>(glut:WarpPointer INTEGER INTEGER)</procedure>
272<procedure>(glut:VideoResizeGet INTEGER)</procedure>
273<procedure>(glut:SetupVideoResizing)</procedure>
274<procedure>(glut:StopVideoResizing)</procedure>
275<procedure>(glut:VideoResize INTEGER INTEGER INTEGER INTEGER)</procedure>
276<procedure>(glut:VideoPan INTEGER INTEGER INTEGER INTEGER)</procedure>
277<procedure>(glut:ReportErrors)</procedure>
278<procedure>(glut:IgnoreKeyRepeat BOOLEAN)</procedure>
279<procedure>(glut:SetKeyRepeat INTEGER)</procedure>
280<procedure>(glut:ForceJoystickFunc)</procedure>
281<procedure>(glut:GameModeString STRING)</procedure>
282<procedure>(glut:EnterGameMode)</procedure>
283<procedure>(glut:LeaveGameMode)</procedure>
284<procedure>(glut:GameModeGet INTEGER)</procedure>
285
286Constants and procedures for the OpenGL GLUT API. Note that
287{{glutInit}} will be called automatically after the {{(opengl glut)}}
288extension is loaded.
289
290=== Examples
291
292A most trivial example: a white rectangle
293
294<enscript highlight="scheme">
295(require-extension gl glut)
296
297(glut:CreateWindow "simple")
298
299(glut:DisplayFunc
300 (lambda ()
301   (gl:Clear gl:COLOR_BUFFER_BIT)
302   (gl:Begin gl:POLYGON)
303   (gl:Vertex2f -0.5 -0.5)
304   (gl:Vertex2f -0.5 0.5)
305   (gl:Vertex2f 0.5 0.5)
306   (gl:Vertex2f 0.5 -0.5)
307   (gl:End)
308   (gl:Flush) ) )
309
310(gl:ClearColor 0 0 0 1)
311(glut:MainLoop)
312</enscript>
313
314The well-known "gears" example can be found in the {{gears.scm}} file
315in the egg distribution.
316
317=== Changelog
318
319* 1.14 Removed use of {{___callback}}
320* 1.13 Initial version that is separate from the [[opengl]] egg
321
322=== License
323
324  Copyright (c) 2004-2006, Felix L. Winkelmann
325  All rights reserved.
326 
327  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
328  conditions are met:
329 
330    Redistributions of source code must retain the above copyright notice, this list of conditions and the following
331      disclaimer.
332    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
333      disclaimer in the documentation and/or other materials provided with the distribution.
334    Neither the name of the author nor the names of its contributors may be used to endorse or promote
335      products derived from this software without specific prior written permission.
336 
337  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
338  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
339  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
340  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
341  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
342  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
343  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
344  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
345  POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.