[Factor-talk] How do I call glutInit(int* argcp, char** argv) from Factor?

2007-05-22 Thread Jeff Ervin
I'm using the Factor 0.89 OpenGL library and wish to call glut functions from Factor in order run redbook examples. I created a factor file with the following code for a start: IN: glut USING: kernel alien ; LIBRARY: glut FUNCTION: void glutInit( int *argcp, char **argv ) ; I then loaded the

Re: [Factor-talk] How do I call glutInit(int* argcp, char** argv) from Factor?

2007-05-22 Thread Slava Pestov
Hi, You should not use GLUT with Factor. Instead, use the Factor UI; define a new gadget class, and give it a draw-gadget* method which makes GL calls. Take a look at the libs/canvas library; it provides wrappers for some of this. Relevant documentation: http://factorcode.org/responder/he

Re: [Factor-talk] How do I call glutInit(int* argcp, char** argv) from Factor?

2007-05-22 Thread Slava Pestov
Hi, I guess I'll answer your original question too, in case you ever come across another C library that needs a char** or an int*. To create a pointer to an int allocated in the Factor heap, use the word: FUNCTION: void foo ( int* bar ) ; 123 foo A char** is just a pointer to an array of