opengl
opengl copied to clipboard
invalid operation for glEnd
When i run the Examples, sometimes its get an error if the Program tries to use glEnd. Here is a log of the nehe_lesson02.rb run on Windows 7 with Ruby 2.4.2-2
D:/Ruby24/lib/ruby/gems/2.4.0/gems/opengl-0.10.0-x86-mingw32/lib/opengl.rb:46:in `glBegin': invalid operation for glEnd (Gl::Error)
from D:/Ruby24/lib/ruby/gems/2.4.0/gems/opengl-0.10.0-x86-mingw32/lib/opengl.rb:46:in `block (2 levels) in <module:Gl>'
from nehe_lesson02.rb:68:in `draw_gl_scene'
from nehe_lesson02.rb:39:in `init_gl_window'
from nehe_lesson02.rb:115:in `<main>'
If you put glBegin and glEnd within a display list, it will work, but glEnd by itself still dies. It's a bizarre error.
This is strange. Anyway this fork sadly seems to be dead.
-
Edit opengl.rb
-
Insert begin/rescue around implementation.send:
define_singleton_method(mn) do |*args,&block| begin implementation.send(mn, *args, &block) rescue end end define_method(mn) do |*args,&block| begin implementation.send(mn, *args, &block) rescue end end
This is a kludge of course, but I can now execute my opengl code.
Sorry, I currently don't have the time to help you, but I added a section about maintenance to the README.