2 //metadoc GLU copyright Steve Dekorte 2002
3 //metadoc GLU license BSD revised
4 //metadoc GLU category Graphics
11 #include "IoCFunction.h"
15 #include "IoGLUQuadric.h"
18 #define DATA(self) ((IoGLUData *)IoObject_dataPointer(self))
20 IoTag
*IoGLU_newTag(void *state
)
22 IoTag
*tag
= IoTag_newWithName_("GLU");
23 IoTag_state_(tag
, state
);
24 IoTag_cloneFunc_(tag
, (IoTagCloneFunc
*)IoGLU_rawClone
);
25 IoTag_freeFunc_(tag
, (IoTagFreeFunc
*)IoGLU_free
);
26 IoTag_markFunc_(tag
, (IoTagMarkFunc
*)IoGLU_mark
);
30 IoGLU
*IoGLU_proto(void *state
)
32 IoObject
*self
= IoObject_new(state
);
33 IoObject_tag_(self
, IoGLU_newTag(state
));
35 IoState_registerProtoWithFunc_(state
, self
, IoGLU_proto
);
36 IoGLU_protoInit(self
);
40 IoGLU
*IoGLU_new(void *state
)
41 { return IoState_protoWithInitFunction_(state
, IoGLU_proto
); }
43 void IoGLU_free(IoGLU
*self
)
45 /* add code to shut down GLU */
46 /*free(IoObject_dataPointer(self));*/
49 void IoGLU_mark(IoGLU
*self
)
52 /* ----------------------------------------------------------- */
54 IoObject
*IoGLU_rawClone(IoGLU
*self
)
55 { return IoState_protoWithInitFunction_(IOSTATE
, IoGLU_proto
); }
57 /* --- GLU -------------------------------------------------------- */
59 void GLU_getDoubleVector(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
, List
*list
, GLdouble
**v
, int max
, char *desc
)
65 *v
=(GLdouble
*)malloc(List_size(list
)*sizeof(GLdouble
));
68 for (i
= 0; i
< List_size(list
) && ((max
==0) || (i
<max
)); i
++)
70 IoNumber
*num
= List_at_(list
, i
);
75 snprintf(fname
, 48, "Io GL %s", desc
);
76 IoState_error_(IOSTATE
, m
, "%s parameter List item #%i must be a Number", fname
, i
);
79 *v
[i
] = IoNumber_asDouble(num
);
83 void GLU_getIntVector(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
, List
*list
, GLint
**v
, int max
, char *desc
)
89 *v
=(GLint
*)malloc(List_size(list
)*sizeof(GLint
));
92 for (i
= 0; i
< List_size(list
) && ((max
==0) || (i
<max
)); i
++)
94 IoNumber
*num
= List_at_(list
, i
);
99 snprintf(fname
, 48, "Io GL %s", desc
);
100 IoState_error_(IOSTATE
, m
, "%s parameter List item #%i must be a Number", fname
, i
);
102 *v
[i
] = (GLint
)IoNumber_asInt(num
);
106 IoObject
*IoGLU_gluLookAt(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
108 GLdouble eyeX
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
109 GLdouble eyeY
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
110 GLdouble eyeZ
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
111 GLdouble centerX
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
112 GLdouble centerY
= IoMessage_locals_doubleArgAt_(m
, locals
, 4);
113 GLdouble centerZ
= IoMessage_locals_doubleArgAt_(m
, locals
, 5);
114 GLdouble upX
= IoMessage_locals_doubleArgAt_(m
, locals
, 6);
115 GLdouble upY
= IoMessage_locals_doubleArgAt_(m
, locals
, 7);
116 GLdouble upZ
= IoMessage_locals_doubleArgAt_(m
, locals
, 8);
118 gluLookAt(eyeX
, eyeY
, eyeZ
, centerX
, centerY
, centerZ
, upX
, upY
, upZ
);
122 IoObject
*IoGLU_gluPerspective(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
124 GLdouble fovy
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
125 GLdouble aspect
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
126 GLdouble zNear
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
127 GLdouble zFar
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
129 gluPerspective(fovy
, aspect
, zNear
, zFar
);
133 IoObject
*IoGLU_gluOrtho2D(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
135 GLdouble l
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
136 GLdouble r
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
137 GLdouble b
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
138 GLdouble t
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
140 gluOrtho2D(l
, r
, b
, t
);
144 IoObject
*IoGLU_gluBuild1DMipmaps(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
146 GLenum target
= IoMessage_locals_intArgAt_(m
, locals
, 0);
147 GLint internalFormat
= IoMessage_locals_intArgAt_(m
, locals
, 1);
148 GLsizei width
= IoMessage_locals_intArgAt_(m
, locals
, 2);
149 GLenum format
= IoMessage_locals_intArgAt_(m
, locals
, 3);
150 GLenum type
= IoMessage_locals_intArgAt_(m
, locals
, 4);
151 IoSeq
*data
= IoMessage_locals_seqArgAt_(m
, locals
, 5);
152 GLvoid
*pointer
= (GLvoid
*)IoSeq_rawBytes(data
);
155 r
= gluBuild1DMipmaps(target
,internalFormat
,width
,format
,type
,pointer
);
159 IoObject
*IoGLU_gluBuild2DMipmaps(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
161 GLenum target
= IoMessage_locals_intArgAt_(m
, locals
, 0);
162 GLint internalFormat
= IoMessage_locals_intArgAt_(m
, locals
, 1);
163 GLsizei width
= IoMessage_locals_intArgAt_(m
, locals
, 2);
164 GLsizei height
= IoMessage_locals_intArgAt_(m
, locals
, 3);
165 GLenum format
= IoMessage_locals_intArgAt_(m
, locals
, 4);
166 GLenum type
= IoMessage_locals_intArgAt_(m
, locals
, 5);
167 IoSeq
*data
= IoMessage_locals_seqArgAt_(m
, locals
, 6);
168 GLvoid
*pointer
= (GLvoid
*)IoSeq_rawBytes(data
);
171 r
= gluBuild2DMipmaps(target
,internalFormat
,width
,height
,format
,type
,pointer
);
175 IoObject
*IoGLU_gluErrorString(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
177 GLenum name
= IoMessage_locals_intArgAt_(m
, locals
, 0);
180 r
= (GLubyte
*)gluErrorString(name
);
184 IoObject
*IoGLU_gluGetString(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
186 GLenum name
= IoMessage_locals_intArgAt_(m
, locals
, 0);
189 r
= (GLubyte
*)gluGetString(name
);
193 IoObject
*IoGLU_gluPickMatrix(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
195 GLdouble x
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
196 GLdouble y
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
197 GLdouble delX
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
198 GLdouble delY
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
199 GLint viewport
= IoMessage_locals_intArgAt_(m
, locals
, 4);
201 gluPickMatrix(x
,y
,delX
,delY
,&viewport
);
205 IoObject
*IoGLU_gluProject(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
207 GLdouble objX
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
208 GLdouble objY
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
209 GLdouble objZ
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
210 List
*list1
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 3));
211 List
*list2
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 4));
212 List
*list3
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 5));
213 IoList
*list4
= IoMessage_locals_listArgAt_(m
, locals
, 6);
214 IoList
*list5
= IoMessage_locals_listArgAt_(m
, locals
, 7);
215 IoList
*list6
= IoMessage_locals_listArgAt_(m
, locals
, 8);
216 GLdouble model
[16] = {
222 GLdouble proj
[16] = {
229 GLdouble winX
[1]={0.0};
230 GLdouble winY
[1]={0.0};
231 GLdouble winZ
[1]={0.0};
234 GLU_getDoubleVector(self
,locals
,m
,list1
,(GLdouble
**)&model
,16,"gluProject");
235 GLU_getDoubleVector(self
,locals
,m
,list2
,(GLdouble
**)&proj
,16,"gluProject");
236 GLU_getIntVector(self
,locals
,m
,list3
,(GLint
**)&view
,1,"gluProject");
237 r
= gluProject(objX
,objY
,objZ
,model
,proj
,view
,winX
,winY
,winZ
);
238 IoList_rawAt_put_(list4
,0,IONUMBER(winX
[0]));
239 IoList_rawAt_put_(list5
,0,IONUMBER(winY
[0]));
240 IoList_rawAt_put_(list6
,0,IONUMBER(winZ
[0]));
244 IoObject
*IoGLU_gluUnProject(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
246 GLdouble winX
= IoMessage_locals_doubleArgAt_(m
, locals
, 0);
247 GLdouble winY
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
248 GLdouble winZ
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
249 List
*list1
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 3));
250 List
*list2
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 4));
251 List
*list3
= IoList_rawList(IoMessage_locals_listArgAt_(m
, locals
, 5));
252 IoList
*list4
= IoMessage_locals_listArgAt_(m
, locals
, 6);
253 IoList
*list5
= IoMessage_locals_listArgAt_(m
, locals
, 7);
254 IoList
*list6
= IoMessage_locals_listArgAt_(m
, locals
, 8);
255 GLdouble model
[16] = {
261 GLdouble proj
[16] = {
268 GLdouble objX
[1]={0.0};
269 GLdouble objY
[1]={0.0};
270 GLdouble objZ
[1]={0.0};
273 GLU_getDoubleVector(self
,locals
,m
,list1
,(GLdouble
**)&model
,16,"gluUnproject");
274 GLU_getDoubleVector(self
,locals
,m
,list2
,(GLdouble
**)&proj
,16,"gluUnproject");
275 GLU_getIntVector(self
,locals
,m
,list3
,(GLint
**)&view
,1,"gluUnproject");
276 r
= gluUnProject(winX
,winY
,winZ
,model
,proj
,view
,objX
,objY
,objZ
);
277 IoList_rawAt_put_(list4
,0,IONUMBER(objX
[0]));
278 IoList_rawAt_put_(list5
,0,IONUMBER(objY
[0]));
279 IoList_rawAt_put_(list6
,0,IONUMBER(objZ
[0]));
283 IoObject
*IoGLU_gluUnProjectOrigin(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
293 GLdouble objX
, objY
, objZ
;
296 glGetDoublev(GL_MODELVIEW_MATRIX
, model
);
297 glGetDoublev(GL_PROJECTION_MATRIX
, proj
);
298 glGetIntegerv(GL_VIEWPORT
, view
);
300 r
= gluUnProject(winX
, winY
, winZ
,
302 &objX
, &objY
, &objZ
);
305 UArray
*rv
= UArray_new();
306 UArray_setSize_(rv
, 3);
307 UArray_setEncoding_(rv
, CENCODING_NUMBER
);
308 UArray_setItemType_(rv
, CTYPE_float64_t
);
309 UArray_at_putDouble_(rv
, 0, objX
);
310 UArray_at_putDouble_(rv
, 1, objY
);
311 UArray_at_putDouble_(rv
, 2, objZ
);
312 return IoSeq_newWithUArray_copy_(IOSTATE
, rv
, 0);
316 IoObject
*IoGLU_gluProjectOrigin(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
326 GLdouble objX
, objY
, objZ
;
329 glGetDoublev(GL_MODELVIEW_MATRIX
, model
);
330 glGetDoublev(GL_PROJECTION_MATRIX
, proj
);
331 glGetIntegerv(GL_VIEWPORT
, view
);
333 r
= gluProject(winX
, winY
, winZ
,
335 &objX
, &objY
, &objZ
);
338 UArray
*rv
= UArray_new();
339 UArray_setSize_(rv
, 3);
340 UArray_setEncoding_(rv
, CENCODING_NUMBER
);
341 UArray_setItemType_(rv
, CTYPE_float64_t
);
342 UArray_at_putDouble_(rv
, 0, objX
);
343 UArray_at_putDouble_(rv
, 1, objY
);
344 UArray_at_putDouble_(rv
, 2, objZ
);
345 return IoSeq_newWithUArray_copy_(IOSTATE
, rv
, 0);
349 IoObject
*IoGLU_gluScaleImage(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
351 GLenum format
= IoMessage_locals_intArgAt_(m
, locals
, 0);
352 GLsizei wIn
= IoMessage_locals_intArgAt_(m
, locals
, 1);
353 GLsizei hIn
= IoMessage_locals_intArgAt_(m
, locals
, 2);
354 GLenum typeIn
= IoMessage_locals_intArgAt_(m
, locals
, 3);
355 IoSeq
*dataIn
= IoMessage_locals_seqArgAt_(m
, locals
, 4);
356 GLsizei wOut
= IoMessage_locals_intArgAt_(m
, locals
, 5);
357 GLsizei hOut
= IoMessage_locals_intArgAt_(m
, locals
, 6);
358 GLenum typeOut
= IoMessage_locals_intArgAt_(m
, locals
, 7);
359 IoSeq
*dataOut
= IoMessage_locals_seqArgAt_(m
, locals
, 8);
360 GLvoid
*pointerIn
= (GLvoid
*)IoSeq_rawBytes(dataIn
);
361 GLvoid
*pointerOut
= (GLvoid
*)IoSeq_rawBytes(dataOut
);
364 r
= gluScaleImage(format
,wIn
,hIn
,typeIn
,pointerIn
,wOut
,hOut
,typeOut
,pointerOut
);
368 /* --- Quadrics ----------------------------------------------------------------*/
370 IoObject
*IoGLU_gluNewQuadric(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
372 IoObject
*obj
= IoGLUQuadric_new(IOSTATE
);
373 IoGLUQuadric_quadric(obj
);
377 IoObject
*IoGLU_gluDeleteQuadric(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
379 /* this gets done automatically when it's garbage collected */
383 IoObject
*IoGLU_gluDisk(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
385 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
386 GLdouble inner
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
387 GLdouble outer
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
388 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 3);
389 GLint stacks
= IoMessage_locals_intArgAt_(m
, locals
, 4);
391 gluDisk(IoGLUQuadric_quadric(q
), inner
, outer
, slices
, stacks
);
395 IoObject
*IoGLU_gluPartialDisk(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
397 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
398 GLdouble inner
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
399 GLdouble outer
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
400 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 3);
401 GLint stacks
= IoMessage_locals_intArgAt_(m
, locals
, 4);
402 GLdouble start
= IoMessage_locals_doubleArgAt_(m
, locals
, 5);
403 GLdouble sweep
= IoMessage_locals_doubleArgAt_(m
, locals
, 6);
405 gluPartialDisk(IoGLUQuadric_quadric(q
), inner
, outer
, slices
, stacks
, start
, sweep
);
409 IoObject
*IoGLU_gluCylinder(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
411 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
412 GLdouble base
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
413 GLdouble top
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
414 GLdouble height
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
415 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 4);
416 GLint stacks
= IoMessage_locals_intArgAt_(m
, locals
, 5);
418 gluCylinder(IoGLUQuadric_quadric(q
), base
, top
, height
, slices
, stacks
);
422 IoObject
*IoGLU_gluQuadricDrawStyle(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
424 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
425 GLenum draw
= IoMessage_locals_intArgAt_(m
, locals
, 1);
427 gluQuadricDrawStyle(IoGLUQuadric_quadric(q
), draw
);
431 IoObject
*IoGLU_gluQuadricNormals(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
433 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
434 GLenum draw
= IoMessage_locals_intArgAt_(m
, locals
, 1);
436 gluQuadricNormals(IoGLUQuadric_quadric(q
), draw
);
440 IoObject
*IoGLU_gluQuadricOrientation(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
442 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
443 GLenum
or = IoMessage_locals_intArgAt_(m
, locals
, 1);
445 gluQuadricOrientation(IoGLUQuadric_quadric(q
), or);
449 IoObject
*IoGLU_gluQuadricTexture(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
451 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
452 GLboolean t
= IoMessage_locals_intArgAt_(m
, locals
, 1);
454 gluQuadricTexture(IoGLUQuadric_quadric(q
), t
);
458 IoObject
*IoGLU_gluSphere(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
460 IoGLUQuadric
*q
= IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0);
461 GLdouble radius
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
462 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 2);
463 GLint stacks
= IoMessage_locals_intArgAt_(m
, locals
, 3);
465 gluSphere(IoGLUQuadric_quadric(q
), radius
, slices
, stacks
);
469 void gluRoundedBox(GLUquadricObj
*quadric
, GLdouble w
, GLdouble h
, GLdouble r
, GLint slices
)
471 if (r
* 2.0 > w
) r
= w
/ 2.0;
472 if (r
* 2.0 > h
) r
= h
/ 2.0;
474 glRectd(r
, r
, w
- r
, h
- r
); // middle
475 glRectd(0, r
, r
, h
- r
); // left
476 glRectd(w
- r
, r
, w
, h
- r
); // right
477 glRectd(r
, h
-r
, w
- r
, h
); // top
478 glRectd(r
, 0, w
-r
, r
); // bottom
480 gluQuadricDrawStyle(quadric
, GLU_FILL
);
483 glTranslated(r
, r
, 0);
484 gluPartialDisk(quadric
, 0, r
, slices
, 1, 180, 90);
488 glTranslated(r
, h
-r
, 0);
489 gluPartialDisk(quadric
, 0, r
, slices
, 1, 0, -90);
493 glTranslated(w
-r
, h
-r
, 0);
494 gluPartialDisk(quadric
, 0, r
, slices
, 1, 0, 90);
498 glTranslated(w
-r
, r
, 0);
499 gluPartialDisk(quadric
, 0, r
, slices
, 1, 90, 90);
503 void gluRoundedBoxOutline(GLUquadricObj
*quadric
, GLdouble w
, GLdouble h
, GLdouble r
, GLint slices
)
505 if (r
* 2.0 > w
) r
= w
/ 2.0;
506 if (r
* 2.0 > h
) r
= h
/ 2.0;
512 glVertex2d(0, h
- r
);
516 glVertex2d(w
, h
- r
);
528 gluQuadricDrawStyle(quadric
, GLU_LINE
);
531 glTranslated(r
, r
, 0);
532 gluPartialDisk(quadric
, r
, r
, slices
, 1, 180, 90);
536 glTranslated(r
, h
-r
, 0);
537 gluPartialDisk(quadric
, r
, r
, slices
, 1, 0, -90);
541 glTranslated(w
-r
, h
-r
, 0);
542 gluPartialDisk(quadric
, r
, r
, slices
, 1, 0, 90);
546 glTranslated(w
-r
, r
, 0);
547 gluPartialDisk(quadric
, r
, r
, slices
, 1, 90, 90);
551 IoObject
*IoGLU_gluRoundedBox(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
553 GLUquadricObj
*q
= IoGLUQuadric_quadric(IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0));
554 GLdouble w
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
555 GLdouble h
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
556 GLdouble r
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
557 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 4);
559 gluRoundedBox(q
, w
, h
, r
, slices
);
565 IoObject
*IoGLU_gluRoundedBoxOutline(IoGLU
*self
, IoObject
*locals
, IoMessage
*m
)
567 GLUquadricObj
*q
= IoGLUQuadric_quadric(IoMessage_locals_gluQuadricArgAt_(m
, locals
, 0));
568 GLdouble w
= IoMessage_locals_doubleArgAt_(m
, locals
, 1);
569 GLdouble h
= IoMessage_locals_doubleArgAt_(m
, locals
, 2);
570 GLdouble r
= IoMessage_locals_doubleArgAt_(m
, locals
, 3);
571 GLint slices
= IoMessage_locals_intArgAt_(m
, locals
, 4);
573 gluRoundedBoxOutline(q
, w
, h
, r
, slices
);
579 /* -------------------------------------------------------------------*/
581 #include "IoGLUconst.h"
582 #include "IoGLUfunc.h"
584 void IoGLU_protoInit(IoGLU
*self
)
586 IoObject_setSlot_to_(self
, IOSYMBOL("clone"), IOCFUNCTION(IoObject_self
, NULL
));
590 t_ioGLU_constTable
*curpos
=ioGLU_constTable
;
594 IoObject_setSlot_to_(self
, IOSYMBOL(curpos
->name
), IONUMBER(curpos
->value
));
601 t_ioGLU_funcTable
*curpos
=ioGLU_funcTable
;
605 IoCFunction
*f
= IoCFunction_newWithFunctionPointer_tag_name_(IOSTATE
, curpos
->func
, NULL
, curpos
->name
);
607 IoObject_setSlot_to_(self
, IOSYMBOL(curpos
->name
), f
);