Hi guys,
I don't know why, but I got some issues with Ruby OpenGL lately. I have some weird errors within a glBegin...glEnd block, like the one below :
`glEnd': invalid operation for glEnd (Gl::Error)
I found something that seems related, but kinda old, on this board :
https://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=570I went with the minimal code I can get to test it out :
require 'gosu'
require 'gl'
require 'glu'
include Gl, Glu
class Window < Gosu::Window
def initialize
super(640, 480, false)
end
def button_down(id)
super
exit if id == Gosu::KbEscape
end
def draw
gl do
begin
glBegin(GL_QUADS)
glVertex3f(10, 10, 0)
glVertex3f(110, 10, 0)
glVertex3f(110, 110, 0)
glVertex3f(10, 110, 0)
glEnd
rescue; end
end
end
end
Window.new.show
In this case, because of the exception handling, the program doesn't crash and the quad is displayed on the screen. If I comment the begin...rescue, I get the error I mentionned.
I only get this error on lauching the program, doesn't seem to occur later. Would someone have an idea ?
Thanks a lot !