[Gambas-user] Does anyone have experience with gb.openGL and "Not an object"?

Francis Payne roseking at ...3413...
Fri Jan 9 21:38:26 CET 2015


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 ?

[System]
Gambas=3.5.2
OperatingSystem=Linux
Kernel=3.2.0-57-generic-pae
Architecture=x86
Distribution=Ubuntu 12.04 LTS
Desktop=KDE4
Theme=QGtk
Language=en_US.UTF-8
Memory=12108M
[Libraries]
Cairo=libcairo.so.2.11000.2
Curl=libcurl.so.4.2.0
DBus=libdbus-1.so.3.5.8
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.1.0
GTK+=libgtk-x11-2.0.so.0.2400.10
Poppler=libpoppler.so.19.0.0
Qt4=libQtCore.so.4.8.1
SDL=libSDL-1.2.so.0.11.3




More information about the User mailing list