[REBOL] Re: Joystick with View/Pro on win98
From: allenk:powerup:au at: 5-Sep-2001 22:28
----- Original Message -----
From: "Cal Dixon" <[deadzaphod--flyingparty--com]>
To: <[rebol-list--rebol--com]>
Sent: Wednesday, September 05, 2001 3:21 PM
Subject: [REBOL] Re: Joystick with View/Pro on win98
> > Very cool! Man, I hate being a beginner again.<g> Now I can see I'll
have
> to
> > learn about interfacing with DLLs...along with everything else.
>
> Hey, I've just been looking through various docs, and it looks like it
would
> be possible to use OpenGL from rebol.. ;-)
>
> Cal
I recall Jeff posting some code to do that back in beta testing for Command
1.0, it was for linux though. Not sure if it is any use/interest for you or
not, but reposting anyway ...
----- Original Message -----
From: <[whip--cs--unm--edu]>
Sent: Wednesday, July 05, 2000 8:19 AM
Subject: [COMMAND] REBOL/command and opengl
Hi, folks. Today I got REBOL/command working with Mesa OpenGL
on my linux box. Rather than post a bunch of C source code, I'll just
describe the process I took:
Basically, I turned the Mesa bouncing ball demo into a shared library
(changing main() into a function named "go"). One other important
detail was that I needed to do a minor hack to the glut library to
overcome the endless glutMainLoop problem. Details on doing that are
found at:
http://web2.airmail.net/sjbaker1/software/glut_hack.html
What I did was rebuild glut to include a single pass
glutMainLoopUpdate function instead of the never returning
glutMainLoop. The whole process was quite painless, really just cut
and paste. With glut rebuilt and installed, I added a function to my
bouncing ball library code which just does the call to
glutMainLoopupdate and returns. The final REBOL/command script is
this tiny little proof of concept:
REBOL [
Title: "REBOL/command using Mesa OpenGL"
]
glib: load/library %./bounce-lib.so
go: make routine! [return: [int]] glib "go"
bupdate: make routine! [] glib "bounce_update"
go
loop 2000 [
prin "."
bupdate
]
halt
{
Instead of printing a dot, the script could be calling other
external library routines to modify the state of the 3d
environment based on who knows what.
What could REBOL/command use OpenGL for? I dunno, a 3d
emailer, a distributed 3d data visualizer.. endless
possibilities.
Sorry if my description of how to make it work is too vague,
but maybe I'll write up a more detailed doc on doing it some
time soon.
-jeff
}