Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid operation for glEnd #18

Open
itgenie98 opened this issue Nov 3, 2017 · 4 comments
Open

invalid operation for glEnd #18

itgenie98 opened this issue Nov 3, 2017 · 4 comments

Comments

@itgenie98
Copy link

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>'
@bookface
Copy link

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

@itgenie98
Copy link
Author

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

@bookface
Copy link

  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.

@larskanis
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants