opengl icon indicating copy to clipboard operation
opengl copied to clipboard

invalid operation for glEnd

Open itgenie98 opened this issue 8 years ago • 4 comments
trafficstars

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>'

itgenie98 avatar Nov 03 '17 15:11 itgenie98

If you put glBegin and glEnd within a display list, it will work, but glEnd by itself still dies. It's a bizarre error.

bookface avatar Feb 12 '18 03:02 bookface

This is strange. Anyway this fork sadly seems to be dead.

itgenie98 avatar Feb 12 '18 21:02 itgenie98

  1. Edit opengl.rb

  2. 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.

bookface avatar Feb 13 '18 13:02 bookface

Sorry, I currently don't have the time to help you, but I added a section about maintenance to the README.

larskanis avatar Feb 13 '18 14:02 larskanis