code: def __init__(self):
      app.Canvas.__init__(
          self,
          title="Conway game of life",
          size=(512, 512),
          keys="interactive",
      )
  
      # Build programs
      # --------------
      self.comp_size = self.size
      size = self.comp_size + (4,)
      Z = np.zeros(size, dtype=np.float32)
      Z[...] = np.random.randint(0, 2, size)
      Z[:256, :256, :] = 0
      gun = """
          ........................O...........
          ......................O.O...........
          ............OO......OO............OO
          ...........O...O....OO............OO
          OO........O.....O...OO..............
          OO........O...O.OO....O.O...........
          ..........O.....O.......O...........
          ...........O...O....................
          ............OO......................"""
      x, y = 0, 0
      for i in range(len(gun)):
          if gun[i] == "\n":
              y += 1
              x = 0
          elif gun[i] == "O":
              Z[y, x] = 1
          x += 1
  
      self.pingpong = 1
      self.compute = Program(compute_vertex, compute_fragment, 4)
      self.compute["texture"] = Z
      self.compute["position"] = [
          (-1, -1),
          (-1, +1),
          (+1, -1),
          (+1, +1),
      ]
      self.compute["texcoord"] = [(0, 0), (0, 1), (1, 0), (1, 1)]
      self.compute["dx"] = 1.0 / size[1]
      self.compute["dy"] = 1.0 / size[0]
      self.compute["pingpong"] = self.pingpong
  
      self.render = Program(render_vertex, render_fragment, 4)
      self.render["position"] = [(-1, -1), (-1, +1), (+1, -1), (+1, +1)]
      self.render["texcoord"] = [(0, 0), (0, 1), (1, 0), (1, 1)]
      self.render["texture"] = self.compute["texture"]
      self.render["pingpong"] = self.pingpong
  
      self.fbo = FrameBuffer(
          self.compute["texture"], RenderBuffer(self.comp_size)
      )
      set_state(depth_test=False, clear_color="black")
  
      self._timer = app.Timer("auto", connect=self.update, start=True)
  
      self.show()
  
imports: import numpy
  from vispy.gloo import Program, FrameBuffer, RenderBuffer, clear, set_viewport, set_state
  from vispy import app
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()