OpenGL Surface Hang

Any idea why a simple opengl surface app would crash / hang up when moving between screens. The computer does has multiple display adapters.

All the app does it open a window with a opengl surface on it, with a timer calling render every 1/10 of a second.

The render loop is

OpenGL.glMatrixMode(OpenGL.GL_PROJECTION)

//glLoadIdentity β€” replace the current matrix with the identity matrix
OpenGL.glLoadIdentity()

dim c as color = rgb(Rnd() * 255,Rnd() * 255,Rnd() * 255)
'clear the whole screen w/ black
//glClearColor β€” specify clear values for the color buffers
OpenGL.glClearColor( c.Red / 255, c.Green / 255, c.Blue / 255, 0.0 )

//glClear β€” clear buffers to preset values
OpenGL.glClear(OpenGL.GL_COLOR_BUFFER_BIT)

opengl.glFinish()

Works on macos and my windows machines (both with single display adapters)

Maybe @Eugene_Dakin has some feedback. He wrote a book about using OpenGL with Xojo.
See https://scispec.ca/index.php/books/31-program-opengl-32-bits-on-windows-and-osx
I never used it myself, so I can’t help myself.

1 Like