jashkenas / ruby-processing

Code as Art, Art as Code. Processing and Ruby are meant for each other.
http://github.com/jashkenas/ruby-processing/wikis
Other
1.28k stars 94 forks source link

OpenGL Error on 10.6.5 #24

Closed aperiodic closed 11 years ago

aperiodic commented 13 years ago

I'm trying to use OpenGL in a ruby-processing sketch on OS X 10.6.5, but any sketch that tries to set the render_mode to OpenGL just crashes. For example, trying to run the following sketch: require 'ruby-processing'

class Planets < Processing::App
  load_java_library "opengl"
  include_package "processing.opengl"

  def setup
    render_mode OPENGL
    color RGB, 1.0
  end

  def draw
    background 1.0
  end

end

Planets.new :title => "Planets", :width => 1024, :height => 768

produces this stacktrace:

Exception in thread "Animation Thread" processing/core/PApplet.java:996:in `size': processing.core.PApplet$RendererChangeException: null (NativeException)
  from org.jruby.proxy.processing.core.PApplet$Proxy0:-1:in `__super$size'
  from :1:in `size'
  from /Users/dlp/.rvm/gems/jruby-1.5.2/gems/ruby-processing-1.0.9/lib/ruby-processing/app.rb:216:in `size'
  from /Users/dlp/.rvm/gems/jruby-1.5.2/gems/ruby-processing-1.0.9/lib/ruby-processing/app.rb:223:in `render_mode'
  from ./planets_gh.rb:8:in `setup'
  from :1
  ...internal jruby stack elided...
  from org.jruby.proxy.processing.core.PApplet$Proxy0.__super$size(Unknown Source)

but if I comment out the line that sets the render mode, it works fine.

I'm using ruby-processing 1.0.9, and the opengl java library included with Processing 1.2.1 (the latest version as of 12/28/10). My java -version is:

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

Thanks for your time!

thomastraum commented 13 years ago

not sure about your error but that sketch runs fine on my macbook pro on 10.6.6

aperiodic commented 13 years ago

I upgraded to 10.6.6, but I still get this error. Are you using the same versions of Processing and Java as I am?

monkstone commented 11 years ago

Mac has always been a bit odd with processing, lets hope fixes for processing-2.0 fix it all, they had better since processing 2.0 P2D and P3D sketches rely on OPENGL. @aperiodic, @thomastraum are you still interested in ruby-processing? If so please try my development version here https://github.com/monkstone/ruby-processing works best with java-1.7+ (to take advantage of invokedynamic jruby).

monkstone commented 11 years ago

@aperiodic, @thomastraum please note ruby-processing is now updating to processing-2.0, now available here. Three D render mode now defaults to OPENGL (under the hood).

monkstone commented 11 years ago

No-one seems bothered either fixed or can't fix.