Thread: [Fxruby-users] FXGLLine in glviewer
Status: Inactive
Brought to you by:
lyle
From: Peter J. P. <PJP...@UC...> - 2003-06-08 04:20:41
|
Hi, I'm just trying to learn how to use OpenGL in FXRuby. I tried to add the drawing of a line to the glviewer example, using a statement completely analogous to the other objects in the scene, namely, gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) placed after the FXGLCylinder statement, and this produces the error message: in `append': This FXGLObject * already released (RuntimeError). It makes no difference if I create and name the object in a separate statement, and then append it to the group of FXGLObjects; the error still occurs with exactly the same message. Have I done something completely stupid, or is this a bug? Peter -- ************************************************************** Peter J. Puchyr, M. Sc., P. Eng. University of Calgary Dept. of Chemical & Petroleum Engineering 2500 University Drive NW Calgary, Alberta T2N 1N4 (403) 210-9772 |
From: Peter J. P. <PJP...@Sp...> - 2003-06-08 04:47:48
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <font><tt><font color="#000000"><tt> <pre>Hi, I'm just trying to learn how to use OpenGL in FXRuby. I tried to add the drawing of a line to the glviewer example, using a statement completely analogous to the other objects in the scene, namely, gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) placed after the FXGLCylinder statement, and this produces the error message: in `append': This FXGLObject * already released (RuntimeError). It makes no difference if I create and name the object in a separate statement, and then append it to the group of FXGLObjects; the error still occurs with exactly the same message. Have I done something completely stupid, or is this a bug? Peter</pre> </tt></font></tt></font> <pre class="moz-signature" cols="120">-- ************************************************* Peter J. Puchyr, M.Sc., P.Eng. SpaceTime Simulation Corp. #302, 112 - 34 Street N.W. Calgary, Alberta Canada T2N 2X5 (403) 270-0489 </pre> </body> </html> |
From: Joel V. <vj...@PA...> - 2003-06-08 05:21:49
|
Peter J. Puchyr wrote: > Hi, > > I'm just trying to learn how to use OpenGL in FXRuby. I tried > to add the drawing of a line to the glviewer example, using a > statement completely analogous to the other objects in the scene, > namely, > > gp2.append(FXGLLine.new(-1.0,-1.0,-1.0, 1.0,1.0,1.0)) > > placed after the FXGLCylinder statement, and this produces the > error message: > > in `append': This FXGLObject * already released (RuntimeError). > > It makes no difference if I create and name the object in a separate > statement, and then append it to the group of FXGLObjects; the error > still occurs with exactly the same message. > > Have I done something completely stupid, or is this a bug? > > Peter > I ran into this problem too, and never understood it. So I always append other shapes (such as a very narrow rectangle, instead of a line). Joel |
From: Lyle J. <ly...@kn...> - 2003-06-08 14:28:50
|
Joel VanderWerf wrote: > I ran into this problem too, and never understood it. So I always append > other shapes (such as a very narrow rectangle, instead of a line). Sounds like a bug to me, Peter and Joel. I can't check it out right this minute, but I think I see the problem. I don't think we ever call the base class version of initialize for FXGLLine. See what happens if you modify lib/fox/glshapes.rb and add this as the first line of FXGLLine's initialize method: super() At any rate, I've added this to the bug list and will investigate for myself as soon as possible. Thanks for the bug report, Lyle |
From: Joel V. <vj...@PA...> - 2003-06-08 16:09:51
|
Lyle Johnson wrote: > Joel VanderWerf wrote: > >> I ran into this problem too, and never understood it. So I always >> append other shapes (such as a very narrow rectangle, instead of a line). > > > Sounds like a bug to me, Peter and Joel. > > I can't check it out right this minute, but I think I see the problem. I > don't think we ever call the base class version of initialize for > FXGLLine. See what happens if you modify lib/fox/glshapes.rb and add > this as the first line of FXGLLine's initialize method: > > super() > > At any rate, I've added this to the bug list and will investigate for > myself as soon as possible. That almost does it. You also need to define #bounds like this: def bounds FXRange.new([@fm.pos[0], @to.pos[0]].min, [@fm.pos[0], @to.pos[0]].max, [@fm.pos[1], @to.pos[1]].min, [@fm.pos[1], @to.pos[1]].max, [@fm.pos[2], @to.pos[2]].min, [@fm.pos[2], @to.pos[2]].max) end |