We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › ruby-processing and GLTexture
Page Index Toggle Pages: 1
ruby-processing and GLTexture (Read 2129 times)
ruby-processing and GLTexture
Oct 19th, 2009, 1:43pm
 
Hi, i am trying to use the GLTexture library for processing (can't post link) with ruby-processing but i just can't get it right. Is it even possible?
I have tried dropping the jar in the library catalog of ruby processing and importing it via a billion different combinations of load_library, load_java_library, import and require but no luck.
Plz help, i'm going crazy Smiley
/Mart
Re: ruby-processing and GLTexture
Reply #1 - Oct 19th, 2009, 7:50pm
 
Hi Mart.

It's certainly possible to use the GLTexture library from Ruby-Processing. Here's a ported version of Andreas' Basic Use example. If you drop it in the BasicUse folder in the GLTexture examples (so that it has access to its data folder), this sketch will run just fine:

http://gist.github.com/213947

The part that probably tripped you up is needing to explicitly import the GLTexture classes that you're going to use -- a necessary aspect of JRuby's current Java integration.

Cheers,
-- Jeremy
Re: ruby-processing and GLTexture
Reply #2 - Oct 20th, 2009, 12:06pm
 
Still no luck (sorry for stacktrace post but i can't post links):
marten@martMBP ~/Downloads/gltexture/gltexture/examples/BasicUse$ rp5 run basic_use.rb
(eval):1:in `class_eval': cannot load Java class codeanticode.gltexture.GLTexture (NameError)
from file:/opt/local/lib/ruby/gems/1.8/gems/ruby-processing-1.0.8/lib/core/jruby-comp
lete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ex
t/object.rb:71:in `include_class'
from file:/opt/local/lib/ruby/gems/1.8/gems/ruby-processing-1.0.8/lib/core/jruby-comp
lete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ex
t/object.rb:44:in `each'
from file:/opt/local/lib/ruby/gems/1.8/gems/ruby-processing-1.0.8/lib/core/jruby-comp
lete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ex
t/object.rb:44:in `include_class'
from basic_use.rb:9:in `class_eval'
from /opt/local/lib/ruby/gems/1.8/gems/ruby-processing-1.0.8/lib/ruby-processing/runn
ers/base.rb:40:in `load_and_run_sketch'
from /opt/local/lib/ruby/gems/1.8/gems/ruby-processing-1.0.8/lib/ruby-processing/runn
ers/run.rb:7
marten@martMBP ~/Downloads/gltexture/gltexture/examples/BasicUse$
marten@martMBP ~/Downloads/gltexture/gltexture/examples/BasicUse$ rp5 -v
Ruby-Processing version 1.0.8

Re: ruby-processing and GLTexture
Reply #3 - Oct 20th, 2009, 1:37pm
 
update: Managed to load GLTexture lib by putting the gltexture.jar  in a catalog named gltexture in library. Thanks Jeremy
/Mart
Page Index Toggle Pages: 1