code: def on_display():
      """Render the particles"""
      # Update or particle positions by calling the OpenCL kernel
      cl.enqueue_acquire_gl_objects(
          queue, [cl_gl_position, cl_gl_color]
      )
      kernelargs = (
          cl_gl_position,
          cl_gl_color,
          cl_velocity,
          cl_start_position,
          cl_start_velocity,
          numpy.float32(time_step),
      )
      program.particle_fountain(
          queue, (num_particles,), None, *(kernelargs)
      )
      cl.enqueue_release_gl_objects(
          queue, [cl_gl_position, cl_gl_color]
      )
      queue.finish()
      glFlush()
  
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
      glMatrixMode(GL_MODELVIEW)
      glLoadIdentity()
  
      # Handle mouse transformations
      glTranslatef(
          initial_translate["x"],
          initial_translate["y"],
          initial_translate["z"],
      )
      glRotatef(rotate["x"], 1, 0, 0)
      glRotatef(
          rotate["y"], 0, 1, 0
      )  # we switched around the axis so make this rotate_z
      glTranslatef(translate["x"], translate["y"], translate["z"])
  
      # Render the particles
      glEnable(GL_POINT_SMOOTH)
      glPointSize(2)
      glEnable(GL_BLEND)
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
  
      # Set up the VBOs
      gl_color.bind()
      glColorPointer(4, GL_FLOAT, 0, gl_color)
      gl_position.bind()
      glVertexPointer(4, GL_FLOAT, 0, gl_position)
      glEnableClientState(GL_VERTEX_ARRAY)
      glEnableClientState(GL_COLOR_ARRAY)
  
      # Draw the VBOs
      glDrawArrays(GL_POINTS, 0, num_particles)
  
      glDisableClientState(GL_COLOR_ARRAY)
      glDisableClientState(GL_VERTEX_ARRAY)
  
      glDisable(GL_BLEND)
  
      glutSwapBuffers()
  
file_path: pyopencl/examples/gl_particle_animation.py
imports: import pyopencl
  from pyopencl.tools import get_gl_sharing_context_properties
  from OpenGL.GL import *
  from OpenGL.GLU import *
  from OpenGL.GLUT import *
  from OpenGL.arrays import vbo
  import numpy
  import sys
label_desc: Use image node_id 7 for calling a global function with example usage: on_display() without return types