There's only one way I can see this working: Develop a plugin for
Firefox, using C / C++, that would operate very similar to the way the
Flash plugin works. Your plugin would have a Ruby interpreter embedded
in it, and support OpenGL rendering onto the space provided for it by
the browser. Your plugin would run a Ruby/OpenGL script the same way the
Flash plugin runs .SWF files.
While this would be a really cool plugin (and I'd definitely use it if
it already existed), I think most people decide just to use one of the
existing alternatives (Flash, Shockwave, SVG, or the nifty new Canvas)
once they see the amount of work involved. Plus, these's the drawback of
requiring people to install your plugin before your web page will render
correctly -- that's so dot-com!
Frank Davis
···
-----Original Message-----
From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf
Of Matthew Carlin
Sent: Wednesday, July 26, 2006 2:28 PM
To: ruby-talk ML
Subject: Embedded Ruby and OpenGL
Hi all,
This is my first post on the Ruby forum/mailing list, so I apologize if
I'm doing anything out of turn.
I've been playing with Yoshi's OpenGL, and I'm wondering, is there any
way to make it work with Embedded Ruby in a browser? If not, are we
talking "someone could write a Firefox extension" or are we talking
"this is just fundamentally impossible"? (I don't really know anything
about how Firefox renders things or how browser extensions are written)
Thanks much,
Matthew Carlin
--
Posted via http://www.ruby-forum.com/.
Frank Davis wrote:
There's only one way I can see this working: Develop a plugin for
Firefox, using C / C++, that would operate very similar to the way the
Flash plugin works. Your plugin would have a Ruby interpreter embedded
in it, and support OpenGL rendering onto the space provided for it by
the browser. Your plugin would run a Ruby/OpenGL script the same way the
Flash plugin runs .SWF files.
While this would be a really cool plugin (and I'd definitely use it if
it already existed), I think most people decide just to use one of the
existing alternatives (Flash, Shockwave, SVG, or the nifty new Canvas)
once they see the amount of work involved. Plus, these's the drawback of
requiring people to install your plugin before your web page will render
correctly -- that's so dot-com!
Frank Davis
Flash is equal parts wonderful and stupid. I've never seen this "Canvas"
thing, and I'll definitely check that out. It's good to know the Erb /
OGL thing can be done in principle, though I'd say it's just a bit out
of my league as yet.
As for installing... people do it for things much less cool than 3d
games 
Thanks much,
Matthew Carlin
···
--
Posted via http://www.ruby-forum.com/\.
Frank Davis wrote:
Your plugin would have a Ruby interpreter embedded in it, and
support OpenGL rendering onto the space provided for it by the
browser.
If you want an example of embedding a Ruby interpreter within a C
program, have a look at my project:
http://ruby-vpi.rubyforge.org/
Basically you run the Ruby interpreter within its own pthread and
then have it execute some Ruby script file. But, *make sure* that
you *never* call any Ruby-C-API function from your C program! *Only*
the Ruby thread is allowed to call the Ruby-C-API.
Good luck.