def _test_functionality(backend):
 gl.use_gl(backend)
 with Canvas() as canvas:
  _clear_screen()
  (w, h) = canvas.size
  gl.glViewport(0, 0, w, h)
  gl.glScissor(0, 0, w, h)
  gl.glClearColor(0.0, 0.0, 0.0, 1.0)
  objects = _prepare_vis()
  _clear_screen()
  _draw1()
  _clear_screen()
  _draw2()
  _clear_screen()
  _draw3()
  for (delete_func, handle) in objects:
   delete_func(handle)
  gl.glFinish()

def _test_functionality ( backend ) : gl . use_gl ( backend ) with Canvas ( ) as canvas : _clear_screen ( ) ( w , h ) = canvas . size gl . glViewport ( 0 , 0 , w , h ) gl . glScissor ( 0 , 0 , w , h ) gl . glClearColor ( 0.0 , 0.0 , 0.0 , 1.0 ) objects = _prepare_vis ( ) _clear_screen ( ) _draw1 ( ) _clear_screen ( ) _draw2 ( ) _clear_screen ( ) _draw3 ( ) for ( delete_func , handle ) in objects : delete_func ( handle ) gl . glFinish ( )
create app and canvas so we have a context .