[Gambas-user] Does anyone have experience with gb.openGL and "Not an object"?
Benoît Minisini
gambas at ...1...
Fri Jan 9 21:43:03 CET 2015
Le 09/01/2015 21:38, Francis Payne a écrit :
> I've got an interesting issue with the OpenGL component.
>
> I've been experimenting with OpenGL by going through the NeHe tutorials
> and the MD2Model example provided. The problem is that I sometimes get
> an unexpected message of "Not an object" when GL tries to start.
>
> The skeleton of the code is:
>
>
> Public Sub GLArea1_open()
>
> Gl.ClearDepth(100.0) ' Enables clearing of the depth buffer
> Glu.ClearColor(&H3398C3) ' This will clear the background color to blue
> Gl.DepthFunc(Gl.LESS) ' The type of depth test to do
> Gl.Enable(Gl.DEPTH_TEST) ' Enables depth testing
> Gl.ShadeModel(Gl.SMOOTH) ' Enables smooth color shading
> Gl.Viewport(0, 0, GLArea1.Width, GLArea1.Height)
> Gl.MatrixMode(Gl.PROJECTION)
> Gl.LoadIdentity() 'Reset The Projection Matrix
> Glu.Perspective(45.0, GLArea1.w / GLArea1.Height, 0.1, 3000.0)
> 'Calculate The Aspect Ratio Of The Window
> Glu.LookAt(0, 100, 120, 0, 0, -300, 0, 100, 0)
> Gl.MatrixMode(Gl.MODELVIEW)
>
>
> End
>
> '< OTHER CODE GOES HERE >
>
> Public Sub Button1_Click()
>
> GLArea1.visible = True
>
> End
>
> Let me emphasise that *this skel**eton code works without problems* ! It
> just opens an opengl window in the Glarea.
>
> The problem happens when the 'other code' gets inserted - but the other
> code makes no reference to opengl or the GlArea and consists solely of
> operations on unrelated things like manipulating arrays, working on
> other controls, etc.
>
> I won't post the other code here because there's about 300kb of it. But
> I have gone through it to make sure there are no references that could
> interfere with openGL.
>
> So, fellow Gambas programmers.... I don't expect a specific solution,
> but as a guide, what **sort** of issues generally cause OpenGl to return
> "Not an object" when called ?
>
I can't help without the source code and a way to reproduce the problem.
Regards,
--
Benoît Minisini
More information about the User
mailing list