Skip to content

Instantly share code, notes, and snippets.

@moumar
Created April 7, 2009 14:31
Show Gist options
  • Select an option

  • Save moumar/91256 to your computer and use it in GitHub Desktop.

Select an option

Save moumar/91256 to your computer and use it in GitHub Desktop.
ruby-processing opengl bug on linux
require "ruby-processing"
class BugOpengl < Processing::App
load_library 'opengl'
import "processing.opengl"
def setup
render_mode OPENGL
#render_mode P3D
smooth
end
def draw
lights
background(200)
fill(100)
translate(width/2, height/2)
rotate_x(1)
rotate_y(1)
box(150)
end
end
BugOpengl.new(:width => 640, :height => 480)
__END__
with 'render_mode P3D' everything is ok
with 'render_mode OPENGL' i got the following error
java.lang.IllegalArgumentException: GLDrawableFactory.chooseGraphicsConfiguration() was not used when creating this Component
at com.sun.opengl.impl.x11.X11GLDrawableFactory.getGLDrawable(X11GLDrawableFactory.java:238)
at processing.opengl.PGraphicsOpenGL.allocate(PGraphicsOpenGL.java:190)
at processing.core.PGraphics3D.setSize(PGraphics3D.java:316)
at processing.core.PApplet.makeGraphics(PApplet.java:1165)
at processing.core.PApplet.size(PApplet.java:999)
at processing.core.PApplet.size(PApplet.java:959)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:298)
at org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:259)
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:67)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:192)
at org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:163)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:144)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:112)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:101)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:117)
at org.jruby.RubyClass.finvoke(RubyClass.java:449)
at org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:401)
at org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:230)
at org.jruby.proxy.processing.core.PApplet$Proxy0.setup(Unknown Source)
at processing.core.PApplet.handleDraw(PApplet.java:1400)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "Animation Thread" processing/core/PApplet.java:1212:in `makeGraphics': java.lang.RuntimeException: processing.opengl.PGraphicsOpenGL needs to be updated for the current release of Processing. (NativeException)
from processing/core/PApplet.java:999:in `size'
from processing/core/PApplet.java:959:in `size'
from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
from java/lang/reflect/Method.java:597:in `invoke'
from org/jruby/javasupport/JavaMethod.java:298:in `invokeWithExceptionHandling'
from org/jruby/javasupport/JavaMethod.java:259:in `invoke'
... 21 levels...
from java/lang/Thread.java:619:in `run'
from bug_opengl.rb:8:in `setup'
from :1
Complete Java stackTrace
java.lang.RuntimeException: processing.opengl.PGraphicsOpenGL needs to be updated for the current release of Processing.
at processing.core.PApplet.makeGraphics(PApplet.java:1212)
at processing.core.PApplet.size(PApplet.java:999)
at processing.core.PApplet.size(PApplet.java:959)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:298)
at org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:259)
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:67)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:192)
at org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:163)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:144)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:112)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:101)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:117)
at org.jruby.RubyClass.finvoke(RubyClass.java:449)
at org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:401)
at org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:230)
at org.jruby.proxy.processing.core.PApplet$Proxy0.setup(Unknown Source)
at processing.core.PApplet.handleDraw(PApplet.java:1400)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Thread.java:619)
...internal jruby stack elided...
from processing.core.PApplet.size(PApplet.java:999)
from processing.core.PApplet.size(PApplet.java:959)
from sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
from sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
from sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
from java.lang.reflect.Method.invoke(Method.java:597)
from org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:298)
from org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:259)
from org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:67)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:192)
from org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:163)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:144)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:112)
from org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:101)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:117)
from org.jruby.RubyClass.finvoke(RubyClass.java:449)
from org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:401)
from org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:230)
from org.jruby.proxy.processing.core.PApplet$Proxy0.setup(Unknown Source)
from processing.core.PApplet.handleDraw(PApplet.java:1400)
from processing.core.PApplet.run(PApplet.java:1328)
from java.lang.Thread.run(Thread.java:619)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment