1 /******************************** -*- C -*- ****************************
2  *
3  *	Glut bindings declarations.
4  *
5  *
6  ***********************************************************************/
7 
8 /***********************************************************************
9  *
10  * Copyright 2008 Free Software Foundation, Inc.
11  * Written by Olivier Blanc.
12  *
13  * This file is part of GNU Smalltalk.
14  *
15  * GNU Smalltalk is free software; you can redistribute it and/or modify it
16  * under the terms of the GNU General Public License as published by the Free
17  * Software Foundation; either version 2, or (at your option) any later
18  * version.
19  *
20  * Linking GNU Smalltalk statically or dynamically with other modules is
21  * making a combined work based on GNU Smalltalk.  Thus, the terms and
22  * conditions of the GNU General Public License cover the whole
23  * combination.
24  *
25  * In addition, as a special exception, the Free Software Foundation
26  * give you permission to combine GNU Smalltalk with free software
27  * programs or libraries that are released under the GNU LGPL and with
28  * independent programs running under the GNU Smalltalk virtual machine.
29  *
30  * You may copy and distribute such a system following the terms of the
31  * GNU GPL for GNU Smalltalk and the licenses of the other code
32  * concerned, provided that you include the source code of that other
33  * code when and as the GNU GPL requires distribution of source code.
34  *
35  * Note that people who make modified versions of GNU Smalltalk are not
36  * obligated to grant this special exception for their modified
37  * versions; it is their choice whether to do so.  The GNU General
38  * Public License gives permission to release a modified version without
39  * this exception; this exception also makes it possible to release a
40  * modified version which carries forward this exception.
41  *
42  * GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
43  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
44  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
45  * more details.
46  *
47  * You should have received a copy of the GNU General Public License along with
48  * GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
49  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
50  *
51  ***********************************************************************/
52 
53 #include "config.h"
54 #include "gstpub.h"
55 
56 #include <stdio.h>
57 #include <stdlib.h>
58 #include <string.h>
59 
60 #include GL_GL_H
61 #include GL_GLUT_H
62 
63 static VMProxy *vm_proxy = NULL;
64 
65 #define nil  vm_proxy->nilOOP
66 
67 /* glut.h */
68 
69 /* The number of events is 30. So for now we fix it */
70 #define MAX_OPENGL_EVENTS 30
71 
72 OOP gst_glut_EventsReceivers[MAX_OPENGL_EVENTS];
73 OOP gst_glut_classPointer = NULL;
74 
75 void
gst_glut_connect_signal(OOP receiver,int eventNumber)76 gst_glut_connect_signal(OOP receiver, int eventNumber)
77 {
78 
79   /* Get a pointer to OpenGL class to be able to retreive the event number in the callback functions */
80   if(! gst_glut_classPointer) {
81 	gst_glut_classPointer = OOP_CLASS(receiver);
82   }
83 
84   if(eventNumber < 0 || eventNumber >= MAX_OPENGL_EVENTS)
85 	return;
86 
87   if(gst_glut_EventsReceivers[eventNumber]) {
88 	vm_proxy->unregisterOOP(gst_glut_EventsReceivers[eventNumber]);
89   }
90 
91   vm_proxy->registerOOP(receiver);
92   gst_glut_EventsReceivers[eventNumber] = receiver;
93 }
94 
95 void
gst_glut_SendCallbackMessage(const char * msg,OOP * args,int nArgs)96 gst_glut_SendCallbackMessage(const char* msg, OOP* args, int nArgs)
97 {
98   OOP indexOop, callbackList;
99   OOP receiver, selector;
100   int eventNumber;
101 
102   indexOop = vm_proxy->strMsgSend (gst_glut_classPointer, msg, NULL);
103   if (indexOop == nil)
104     return;
105 
106   eventNumber = vm_proxy->OOPToInt (indexOop);
107   if (gst_glut_EventsReceivers[eventNumber] == nil)
108     return;
109 
110   callbackList = vm_proxy->strMsgSend (gst_glut_EventsReceivers[eventNumber],
111 				       "getCallback:",
112 				       vm_proxy->intToOOP (eventNumber),
113 				       NULL);
114   if (callbackList == nil)
115     return;
116 
117   receiver = OOP_TO_OBJ (callbackList)->data[0];
118   selector = OOP_TO_OBJ (callbackList)->data[1];
119   selector = selector == vm_proxy->nilOOP ? NULL : selector;
120   vm_proxy->nvmsgSend (receiver, selector, args, nArgs);
121 }
122 
123 
124 static void
gst_glut_CreateMenu(int menu)125 gst_glut_CreateMenu(  int menu  )
126 {
127   OOP* args = alloca( sizeof(OOP) * 1 );
128   args[0] = vm_proxy->intToOOP(menu);
129 
130   gst_glut_SendCallbackMessage("createMenuEvent", args, 1);
131 }
132 
133 static void
gst_glut_TimerFunc(int a)134 gst_glut_TimerFunc( int a )
135 {
136   OOP* args = alloca ( sizeof(OOP) * 1 );
137   args[0] = vm_proxy->intToOOP(a);
138 
139   gst_glut_SendCallbackMessage("timerFuncEvent", args, 1);
140 }
141 
142 static void
gst_glut_IdleFunc()143 gst_glut_IdleFunc( )
144 {
145   gst_glut_SendCallbackMessage("idleFuncEvent", &nil, 0);
146 }
147 
148 static void
gst_glut_KeyboardFunc(unsigned char c,int a,int b)149 gst_glut_KeyboardFunc(  unsigned char c, int a, int b  )
150 {
151   OOP* args = alloca ( sizeof(OOP) * 3 );
152   args[0] = vm_proxy->charToOOP(c);
153   args[1] = vm_proxy->intToOOP(a);
154   args[2] = vm_proxy->intToOOP(b);
155 
156   gst_glut_SendCallbackMessage("keyboardFuncEvent", args, 3);
157 }
158 
159 
160 static void
gst_glut_SpecialFunc(int a,int b,int c)161 gst_glut_SpecialFunc( int a, int b, int c )
162 {
163   OOP* args = alloca ( sizeof(OOP) * 3 );
164   args[0] = vm_proxy->intToOOP(a);
165   args[1] = vm_proxy->intToOOP(b);
166   args[2] = vm_proxy->intToOOP(c);
167 
168   gst_glut_SendCallbackMessage("specialFuncEvent", args, 3);
169 }
170 
171 static void
gst_glut_ReshapeFunc(int a,int b)172 gst_glut_ReshapeFunc( int a, int b )
173 {
174   OOP* args = alloca ( sizeof(OOP) * 2 );
175   args[0] = vm_proxy->intToOOP(a);
176   args[1] = vm_proxy->intToOOP(b);
177 
178   gst_glut_SendCallbackMessage("reshapeFuncEvent", args, 2);
179 }
180 
181 static void
gst_glut_VisibilityFunc(int a)182 gst_glut_VisibilityFunc(  int a )
183 {
184   OOP* args = alloca ( sizeof(OOP) * 1 );
185   args[0] = vm_proxy->intToOOP(a);
186   gst_glut_SendCallbackMessage("visibilityFuncEvent", args, 1);
187 }
188 
189 static void
gst_glut_DisplayFunc()190 gst_glut_DisplayFunc()
191 {
192   OOP* args = NULL;
193   gst_glut_SendCallbackMessage("displayFuncEvent", args, 0);
194 }
195 
196 static void
gst_glut_MouseFunc(int a,int b,int c,int d)197 gst_glut_MouseFunc(  int a, int b, int c, int d )
198 {
199   OOP* args = alloca ( sizeof(OOP) * 4 );
200   args[0] = vm_proxy->intToOOP(a);
201   args[1] = vm_proxy->intToOOP(b);
202   args[2] = vm_proxy->intToOOP(c);
203   args[3] = vm_proxy->intToOOP(d);
204 
205   gst_glut_SendCallbackMessage("mouseFuncEvent", args, 4);
206 }
207 
208 static void
gst_glut_MotionFunc(int a,int b)209 gst_glut_MotionFunc(  int a, int b )
210 {
211   OOP* args = alloca ( sizeof(OOP) * 2 );
212   args[0] = vm_proxy->intToOOP(a);
213   args[1] = vm_proxy->intToOOP(b);
214 
215   gst_glut_SendCallbackMessage("motionFuncEvent", args, 2);
216 }
217 
218 static void
gst_glut_PassiveMotionFunc(int a,int b)219 gst_glut_PassiveMotionFunc(  int a, int b )
220 {
221   OOP* args = alloca ( sizeof(OOP) * 2 );
222   args[0] = vm_proxy->intToOOP(a);
223   args[1] = vm_proxy->intToOOP(b);
224 
225   gst_glut_SendCallbackMessage("passiveMotionFuncEvent", args, 2);
226 }
227 
228 static void
gst_glut_EntryFunc(int a)229 gst_glut_EntryFunc(  int a )
230 {
231   OOP* args = alloca ( sizeof(OOP) * 1 );
232   args[0] = vm_proxy->intToOOP(a);
233 
234   gst_glut_SendCallbackMessage("entryFuncEvent", args, 1);
235 }
236 
237 static void
gst_glut_KeyboardUpFunc(unsigned char c,int a,int b)238 gst_glut_KeyboardUpFunc( unsigned char c, int a, int b )
239 {
240   OOP* args = alloca ( sizeof(OOP) * 3 );
241   args[0] = vm_proxy->charToOOP(c);
242   args[1] = vm_proxy->intToOOP(a);
243   args[2] = vm_proxy->intToOOP(b);
244 
245   gst_glut_SendCallbackMessage("keyboardUpFuncEvent", args, 3);
246 }
247 
248 static void
gst_glut_SpecialUpFunc(int a,int b,int c)249 gst_glut_SpecialUpFunc( int a, int b, int c )
250 {
251   OOP* args = alloca ( sizeof(OOP) * 3 );
252   args[0] = vm_proxy->intToOOP(a);
253   args[1] = vm_proxy->intToOOP(b);
254   args[2] = vm_proxy->intToOOP(c);
255 
256   gst_glut_SendCallbackMessage("specialUpFuncEvent", args, 3);
257 }
258 
259 static void
gst_glut_MenuStateFunc(int a)260 gst_glut_MenuStateFunc(  int a )
261 {
262   OOP* args = alloca ( sizeof(OOP) * 1 );
263   args[0] = vm_proxy->intToOOP(a);
264 
265   gst_glut_SendCallbackMessage("menuStateFuncEvent", args, 1);
266 }
267 
268 static void
gst_glut_MenuStatusFunc(int a,int b,int c)269 gst_glut_MenuStatusFunc(  int a, int b, int c )
270 {
271   OOP* args = alloca ( sizeof(OOP) * 3 );
272   args[0] = vm_proxy->intToOOP(a);
273   args[1] = vm_proxy->intToOOP(b);
274   args[2] = vm_proxy->intToOOP(c);
275 
276   gst_glut_SendCallbackMessage("menuStatusFuncEvent", args, 3);
277 }
278 
279 static void
gst_glut_OverlayDisplayFunc()280 gst_glut_OverlayDisplayFunc()
281 {
282 
283 }
284 
285 static void
gst_glut_WindowStatusFunc(int a)286 gst_glut_WindowStatusFunc(  int a )
287 {
288 }
289 
290 static void
gst_glut_SpaceballMotionFunc(int a,int b,int c)291 gst_glut_SpaceballMotionFunc(  int a, int b, int c )
292 {
293   OOP* args = alloca ( sizeof(OOP) * 3 );
294   args[0] = vm_proxy->intToOOP(a);
295   args[1] = vm_proxy->intToOOP(b);
296   args[2] = vm_proxy->intToOOP(c);
297 
298   gst_glut_SendCallbackMessage("motionFuncEvent", args, 3);
299 }
300 
301 static void
gst_glut_SpaceballRotateFunc(int a,int b,int c)302 gst_glut_SpaceballRotateFunc(  int a, int b, int c )
303 {
304 }
305 
306 static void
gst_glut_SpaceballButtonFunc(int a,int b)307 gst_glut_SpaceballButtonFunc(  int a, int b )
308 {
309 }
310 
311 static void
gst_glut_ButtonBoxFunc(int a,int b)312 gst_glut_ButtonBoxFunc(  int a, int b )
313 {
314 }
315 
316 static void
gst_glut_DialsFunc(int a,int b)317 gst_glut_DialsFunc(  int a, int b )
318 {
319 }
320 
321 static void
gst_glut_TabletMotionFunc(int a,int b)322 gst_glut_TabletMotionFunc(  int a, int b )
323 {
324 }
325 
326 static void
gst_glut_TabletButtonFunc(int a,int b,int c,int d)327 gst_glut_TabletButtonFunc(  int a, int b, int c, int d )
328 {
329 }
330 
331 static void
gst_glut_WMCloseFunc()332 gst_glut_WMCloseFunc()
333 {
334 }
335 
336 #if 0
337 static void
338 gst_glut_JoystickFunc( unsigned int a, int b, int c, int d )
339 {
340   OOP* args = alloca ( sizeof(OOP) * 4 );
341   args[0] = vm_proxy->intToOOP(a);
342   args[1] = vm_proxy->intToOOP(b);
343   args[2] = vm_proxy->intToOOP(c);
344   args[3] = vm_proxy->intToOOP(d);
345 
346   gst_glut_SendCallbackMessage("joystickFuncEvent", args, 4);
347 }
348 
349 static void
350 gst_glut_MouseWheelFunc(  int a, int b, int c, int d)
351 {
352 }
353 
354 static void
355 gst_glut_CloseFunc()
356 {
357 }
358 
359 static void
360 gst_glut_MenuDestroyFunc()
361 {
362 }
363 #endif
364 
365 
registerCallbacks()366 static void registerCallbacks ()
367 {
368   glutIdleFunc(gst_glut_IdleFunc);
369   glutKeyboardFunc(gst_glut_KeyboardFunc);
370   glutSpecialFunc(gst_glut_SpecialFunc);
371   glutReshapeFunc(gst_glut_ReshapeFunc);
372   glutVisibilityFunc(gst_glut_VisibilityFunc);
373   glutDisplayFunc(gst_glut_DisplayFunc);
374   glutMouseFunc(gst_glut_MouseFunc);
375   glutMotionFunc(gst_glut_MotionFunc);
376   glutPassiveMotionFunc(gst_glut_PassiveMotionFunc);
377   glutEntryFunc(gst_glut_EntryFunc);
378   glutKeyboardUpFunc(gst_glut_KeyboardUpFunc);
379   glutSpecialUpFunc(gst_glut_SpecialUpFunc);
380   glutMenuStateFunc(gst_glut_MenuStateFunc);
381   glutMenuStatusFunc(gst_glut_MenuStatusFunc);
382   glutOverlayDisplayFunc(gst_glut_OverlayDisplayFunc);
383   glutWindowStatusFunc(gst_glut_WindowStatusFunc);
384   glutSpaceballMotionFunc(gst_glut_SpaceballMotionFunc);
385   glutSpaceballRotateFunc(gst_glut_SpaceballRotateFunc);
386   glutSpaceballButtonFunc(gst_glut_SpaceballButtonFunc);
387   glutButtonBoxFunc(gst_glut_ButtonBoxFunc);
388   glutDialsFunc(gst_glut_DialsFunc);
389   glutTabletMotionFunc(gst_glut_TabletMotionFunc);
390   glutTabletButtonFunc(gst_glut_TabletButtonFunc);
391   glutWMCloseFunc(gst_glut_WMCloseFunc);
392 
393 #if 0
394   glutJoystickFunc(gst_glut_JoystickFunc);
395   glutMouseWheelFunc(gst_glut_MouseWheelFunc);
396   glutCloseFunc(gst_glut_CloseFunc);
397   glutMenuDestroyFunc(gst_glut_MenuDestroyFunc);
398 #endif
399 }
400 
gst_glut_glutCreateSubWindow(int win,int x,int y,int width,int height)401 int gst_glut_glutCreateSubWindow (int win, int x, int y, int width, int height)
402 {
403   int id = glutCreateSubWindow (win, x, y, width, height);
404   registerCallbacks ();
405   return id;
406 }
407 
gst_glut_glutCreateWindow(const char * name)408 int gst_glut_glutCreateWindow (const char *name)
409 {
410   int id = glutCreateWindow (name);
411   registerCallbacks ();
412   return id;
413 }
414 
gst_glut_glutInit(char * argv)415 void gst_glut_glutInit( char* argv )
416 {
417   int pargc = 1;
418   char *v[2] = {argv, NULL};
419   glutInit( &pargc, v );
420 }
421 
gst_glut_glutCreateMenu(void)422 int gst_glut_glutCreateMenu( void )
423 {
424   return glutCreateMenu(gst_glut_CreateMenu);
425 }
426 
gst_glut_glutTimerFunc(unsigned int time,int value)427 void gst_glut_glutTimerFunc( unsigned int time, int value )
428 {
429   glutTimerFunc( time, gst_glut_TimerFunc, value );
430 }
431 
432 void
gst_initModule(VMProxy * proxy)433 gst_initModule(VMProxy *proxy)
434 {
435   int i;
436   vm_proxy = proxy;
437 
438   /* Clear the array */
439   for(i = 0; i <MAX_OPENGL_EVENTS; ++i)
440 	gst_glut_EventsReceivers[i] = nil;
441 
442   vm_proxy->defineCFunc ("openglutConnectSignal", gst_glut_connect_signal);
443 
444   vm_proxy->defineCFunc ("glutInit", gst_glut_glutInit);
445   vm_proxy->defineCFunc ("glutInitWindowPosition", glutInitWindowPosition);
446   vm_proxy->defineCFunc ("glutInitWindowSize", glutInitWindowSize);
447   vm_proxy->defineCFunc ("glutInitDisplayMode", glutInitDisplayMode);
448   vm_proxy->defineCFunc ("glutMainLoop", glutMainLoop);
449   vm_proxy->defineCFunc ("glutCreateWindow", gst_glut_glutCreateWindow);
450   vm_proxy->defineCFunc ("glutCreateSubWindow", gst_glut_glutCreateSubWindow);
451   vm_proxy->defineCFunc ("glutDestroyWindow", glutDestroyWindow);
452   vm_proxy->defineCFunc ("glutSetWindow", glutSetWindow);
453   vm_proxy->defineCFunc ("glutGetWindow", glutGetWindow);
454   vm_proxy->defineCFunc ("glutSetWindowTitle", glutSetWindowTitle);
455   vm_proxy->defineCFunc ("glutSetIconTitle", glutSetIconTitle);
456   vm_proxy->defineCFunc ("glutReshapeWindow", glutReshapeWindow);
457   vm_proxy->defineCFunc ("glutPositionWindow", glutPositionWindow);
458   vm_proxy->defineCFunc ("glutShowWindow", glutShowWindow);
459   vm_proxy->defineCFunc ("glutHideWindow", glutHideWindow);
460   vm_proxy->defineCFunc ("glutIconifyWindow", glutIconifyWindow);
461   vm_proxy->defineCFunc ("glutPushWindow", glutPushWindow);
462   vm_proxy->defineCFunc ("glutPopWindow", glutPopWindow);
463   vm_proxy->defineCFunc ("glutFullScreen", glutFullScreen);
464   vm_proxy->defineCFunc ("glutPostWindowRedisplay", glutPostWindowRedisplay);
465   vm_proxy->defineCFunc ("glutPostRedisplay", glutPostRedisplay);
466   vm_proxy->defineCFunc ("glutSwapBuffers", glutSwapBuffers);
467   vm_proxy->defineCFunc ("glutWarpPointer", glutWarpPointer);
468   vm_proxy->defineCFunc ("glutEstablishOverlay", glutEstablishOverlay);
469   vm_proxy->defineCFunc ("glutRemoveOverlay", glutRemoveOverlay);
470   vm_proxy->defineCFunc ("glutUseLayer", glutUseLayer);
471   vm_proxy->defineCFunc ("glutPostOverlayRedisplay", glutPostOverlayRedisplay);
472   vm_proxy->defineCFunc ("glutPostWindowOverlayRedisplay", glutPostWindowOverlayRedisplay);
473   vm_proxy->defineCFunc ("glutShowOverlay", glutShowOverlay);
474   vm_proxy->defineCFunc ("glutHideOverlay", glutHideOverlay);
475   vm_proxy->defineCFunc ("glutCreateMenu", gst_glut_glutCreateMenu);
476   vm_proxy->defineCFunc ("glutDestroyMenu", glutDestroyMenu);
477   vm_proxy->defineCFunc ("glutGetMenu", glutGetMenu);
478   vm_proxy->defineCFunc ("glutSetMenu", glutSetMenu);
479   vm_proxy->defineCFunc ("glutAddMenuEntry", glutAddMenuEntry);
480   vm_proxy->defineCFunc ("glutAddSubMenu", glutAddSubMenu);
481   vm_proxy->defineCFunc ("glutChangeToMenuEntry", glutChangeToMenuEntry);
482   vm_proxy->defineCFunc ("glutChangeToSubMenu", glutChangeToSubMenu);
483   vm_proxy->defineCFunc ("glutRemoveMenuItem", glutRemoveMenuItem);
484   vm_proxy->defineCFunc ("glutAttachMenu", glutAttachMenu);
485   vm_proxy->defineCFunc ("glutDetachMenu", glutDetachMenu);
486   vm_proxy->defineCFunc ("glutTimerFunc", gst_glut_glutTimerFunc);
487 
488   vm_proxy->defineCFunc ("glutGet", glutGet);
489   vm_proxy->defineCFunc ("glutDeviceGet", glutDeviceGet);
490   vm_proxy->defineCFunc ("glutGetModifiers", glutGetModifiers);
491   vm_proxy->defineCFunc ("glutLayerGet", glutLayerGet);
492   vm_proxy->defineCFunc ("glutBitmapCharacter", glutBitmapCharacter);
493   vm_proxy->defineCFunc ("glutBitmapWidth", glutBitmapWidth);
494   vm_proxy->defineCFunc ("glutStrokeCharacter", glutStrokeCharacter);
495   vm_proxy->defineCFunc ("glutStrokeWidth", glutStrokeWidth);
496   vm_proxy->defineCFunc ("glutBitmapLength", glutBitmapLength);
497   vm_proxy->defineCFunc ("glutStrokeLength", glutStrokeLength);
498   vm_proxy->defineCFunc ("glutWireCube", glutWireCube);
499   vm_proxy->defineCFunc ("glutSolidCube", glutSolidCube);
500   vm_proxy->defineCFunc ("glutWireSphere", glutWireSphere);
501   vm_proxy->defineCFunc ("glutSolidSphere", glutSolidSphere);
502   vm_proxy->defineCFunc ("glutWireCone", glutWireCone);
503   vm_proxy->defineCFunc ("glutSolidCone", glutSolidCone);
504   vm_proxy->defineCFunc ("glutWireTorus", glutWireTorus);
505   vm_proxy->defineCFunc ("glutSolidTorus", glutSolidTorus);
506   vm_proxy->defineCFunc ("glutWireDodecahedron", glutWireDodecahedron);
507   vm_proxy->defineCFunc ("glutSolidDodecahedron", glutSolidDodecahedron);
508   vm_proxy->defineCFunc ("glutWireOctahedron", glutWireOctahedron);
509   vm_proxy->defineCFunc ("glutSolidOctahedron", glutSolidOctahedron);
510   vm_proxy->defineCFunc ("glutWireTetrahedron", glutWireTetrahedron);
511   vm_proxy->defineCFunc ("glutSolidTetrahedron", glutSolidTetrahedron);
512   vm_proxy->defineCFunc ("glutWireIcosahedron", glutWireIcosahedron);
513   vm_proxy->defineCFunc ("glutSolidIcosahedron", glutSolidIcosahedron);
514   vm_proxy->defineCFunc ("glutWireTeapot", glutWireTeapot);
515   vm_proxy->defineCFunc ("glutSolidTeapot", glutSolidTeapot);
516   vm_proxy->defineCFunc ("glutGameModeString", glutGameModeString);
517   vm_proxy->defineCFunc ("glutEnterGameMode", glutEnterGameMode);
518   vm_proxy->defineCFunc ("glutLeaveGameMode", glutLeaveGameMode);
519   vm_proxy->defineCFunc ("glutGameModeGet", glutGameModeGet);
520   vm_proxy->defineCFunc ("glutVideoResizeGet", glutVideoResizeGet);
521   vm_proxy->defineCFunc ("glutSetupVideoResizing", glutSetupVideoResizing);
522   vm_proxy->defineCFunc ("glutStopVideoResizing", glutStopVideoResizing);
523   vm_proxy->defineCFunc ("glutVideoResize", glutVideoResize);
524   vm_proxy->defineCFunc ("glutVideoPan", glutVideoPan);
525   vm_proxy->defineCFunc ("glutSetColor", glutSetColor);
526   vm_proxy->defineCFunc ("glutGetColor", glutGetColor);
527   vm_proxy->defineCFunc ("glutCopyColormap", glutCopyColormap);
528   vm_proxy->defineCFunc ("glutIgnoreKeyRepeat", glutIgnoreKeyRepeat);
529   vm_proxy->defineCFunc ("glutSetKeyRepeat", glutSetKeyRepeat);
530   vm_proxy->defineCFunc ("glutExtensionSupported", glutExtensionSupported);
531   vm_proxy->defineCFunc ("glutReportErrors", glutReportErrors);
532 
533   vm_proxy = vm_proxy;
534 }
535 
536